This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: Mixed declarations and code


On Wed, 9 Jul 2003, Hans-Peter Nilsson wrote:

> I'd like to help getting this warning option in GCC but I'm not
> sure what Joseph asks for by that "intended design" comment.
> This can be a subset of -Wc89/-Wc90/-Wc99 or whatever the full
> monty would be.

Add a function pedwarn_c90 modelled after pedwarn_c99 which is a pedwarn
in C90 mode and a warning in C99 mode.  (With any such warning option -
full or for this specific case - it is wrong for the warning to become an
error if the option is used with -std=c99 -pedantic-errors.)

Change all "if (pedantic && !flag_isoc99) pedwarn(...)" into "if 
((pedantic && !flag_isoc99) || warn_c90) pedwarn_c90(...)".

Add appropriate documentation and testcases, in particular that with 
-std=c99 -pedantic-errors you get warnings and not errors.

-- 
Joseph S. Myers
jsm@polyomino.org.uk


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