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 14:59:46 -0400
> From: Donald Koch <koch@cognex.com>
> 
> > I am currently writting a patch for gcc2 that implements a new command
> > line option '-wunrecognised-pragmas' which will cause warning messages
> > to be generated when GCC encounters pragmas which is does not handle.
> > At the moment this patch also enables these warnings if -Wall is
> > enabled, expect for the case where the pragmas are in system header
> > files.   Is this the right thing to do ?
> 
> If you mean by "this", enabling it with -Wall, no.
> 
> Consider the use of "-Werror -Wall", where the desired effect is to
> make sure there are no iffy constructs in the code; would failure
> to compile because there was an unrecognized pragma which is needed
> for some other compiler/platform be desirable?

No, but failure to compile because the code contained an unrecognised
pragma which was intended to effect code generation is desirable.  Of
course to achieve the effect you want you can do this:

	-Werror -Wall -Wno-unrecognised-pragmas


> -Wall check for too many useful things, which is what it should do.

Sorry, I do not understand that sentance.  Do you mean that -Wall
currently checks for too many things and that you think that adding
another thing to the list is too much ?  Or that it is correct for
-Wall to check for as many things as possible (given its specification
of: 'warning about constructions that some users consider
questionable, and that are easy to avoid'), in which case are you
saying that you do not consider unrecognised pragmas to be
questionable constructions ?

Nick




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