comp.lang.ada
 help / color / mirror / Atom feed
From: csampson@inetworld.net (Charles H. Sampson)
Subject: Re: Missing Index Value in Array Aggregate
Date: Sat, 29 Sep 2007 08:31:40 -0700
Date: 2007-09-29T08:31:40-07:00	[thread overview]
Message-ID: <1i570wf.w0nwjpq56dc2N%csampson@inetworld.net> (raw)
In-Reply-To: utzpfds14.fsf@stephe-leake.org

Stephen Leake <stephen_leake@stephe-leake.org> wrote:

> csampson@inetworld.net (Charles H. Sampson) writes:
> 
> >      I should have given more detail of the context.
> > Although it's not relevant now, here it is: The aggregate
> > was the initial value of a constant array object, the type
> > of that object being an anonymous array type whose index
> > is a constrained enumeration type.  My compiler did give
> > me the (proper) warning of a constraint error at run time.
> > Unfortunately, the warning was overlooked because the
> > compiler tends to put out a bunch of warnings of much
> > less value.
> 
> What compiler?
> 
     I don't want to name names because I think it's a
decent compiler and I wouldn't want to scare off any poten-
tial user because of this minor issue.

> With GNAT, I have a policy to eliminate _all_ warnings by fixing the
> source code. Same with Gnu C, when I'm forced to use that.
> 
> Doing so fixes bugs.
> 
> Sometimes I have to resort to a compiler switch to suppress a
> warning, but very rarely.

     A good practice in general and I've been thinking
about it for our project.  Unfortunately, many of the
warnings are of things that might happen but won't, so it
would mean cluttering the code with something unnecessary,
usually with a small execution penalty, along with
comments about why such a strange thing is being done.
(Although I'm working on a real-time system, the execution
penalty is not an issue because we have more CPU power
than we know what to do with.)  Other warnings are things
we know about but can't change.  The most irritating
involves an array of 6-bit components, needed to interface
external hardware, which generates a warning that the code
is "less efficient" because of the component size.  Less
efficient than what, I've asked.  Code that doesn't work?

I don't think we have an ability to selectively suppress
warnings, although it might have been put in unnoticed by
me in one of the many upgrades in the 10+ years we've been
using this compiler.

               Charlie

-- 
     For an email response, insert "0824" between the 'c' and 's'.



  parent reply	other threads:[~2007-09-29 15:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-26 13:21 Missing Index Value in Array Aggregate Charles H. Sampson
2007-09-26 15:54 ` Adam Beneschan
2007-09-26 23:33   ` Randy Brukardt
2007-09-28  3:21     ` Charles H. Sampson
2007-09-28 10:05       ` Stephen Leake
2007-09-28 10:26         ` Ludovic Brenta
2007-09-28 16:21           ` Pascal Obry
2007-09-28 20:26             ` Maciej Sobczak
2007-10-03 17:01               ` roderick.chapman
2007-09-29 15:31         ` Charles H. Sampson [this message]
2007-09-30 11:02           ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox