This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Should warnings be issued for unrecognised pragmas ?


> Date: Fri, 17 Oct 1997 17:14:00 -0400
> From: Donald Koch <koch@cognex.com>
> 
> > > Date: Fri, 17 Oct 1997 14:59:46 -0400
> > > From: Donald Koch <koch@cognex.com>
> > > 
> > > -Wall check for too many useful things, which is what it should do.
> > 
> > Sorry, I do not understand that sentance.
> [...]
> > Nick
> 
> Sorry, brain slipped out gear mid-sentence.  -Wall should check for
> the most useful warnings.  Adding too many will make it unusable.
> The question basically is: is -Wunrecognised-pragmas going to be used
> much more often than not when -Wall is used?  I don't want to have to
> be adding too many -Wno-... flags.  (Maybe we should add a -Wsome
> or -Wmost flag? ;-)  I guess it depends on what is meant by "all".

And how much is too much.  Personally I suspect that most programmers
only use -Wall occaisionally to see how their source is fairing,
because they are already overwhelmed by the number of warnings it
produces, especially if they have inherited some code from somebody
else. 

> (According to the documentation, this would be determined by whether
> -Wunreconised-pragmas came before or after the description of
> -Wall.)
True.

> I take it that we are targetting some specific pragmas.  Which ones?

True.  The original work came up when we were asked to provide a port
that would support code that had previously been compiled by the Green
Hills toolsuite.  That code used Green Hills specific pragmas in
various places, and in the course of improving the code that handles
this situation I noticed that GCC was not issuing any warnings when it
did not recognise their pragmas.  I am not sure if it is appropriate
for me to describe specific pragmas, since this is really a generic
problem, rather than one of compatibility with a particualr vendor's
toolchain.

To take a specific, invented example however, the "pack" pragma is a 
case in point.  As it happens GCC does handle this pragma, but if it
did not then it could cause all kinds of hard to find errors in the
user's programs, when their structures do not match the sizes expected
by the code.  Not having a warning message to help idenitfy this
situation would only makes finding the "bug" that much harder.

Nick






Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]