This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Mixed declarations and code
- From: "Joseph S. Myers" <jsm at polyomino dot org dot uk>
- To: Hans-Peter Nilsson <hp at bitrange dot com>
- Cc: Zack Weinberg <zack at codesourcery dot com>, Michael Culbertson <Michael dot J dot Culbertson at wheaton dot edu>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 9 Jul 2003 10:46:19 +0100 (BST)
- Subject: Re: Mixed declarations and code
- References: <Pine.BSF.4.44.0307071124580.88982-100000@dair.pair.com>
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