This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] cpplib: -Wno-endif-labels
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- To: Phil Edwards <phil at jaj dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 21 Mar 2002 21:02:09 +0000
- Subject: Re: [PATCH] cpplib: -Wno-endif-labels
- References: <20020321145127.A9482@disaster.basement.lan>
Phil Edwards wrote:-
> As required by ISO C, cpplib warns about the second and third 'foo' in
>
> #if foo
> ...
> #else foo
> ...
> #endif foo
>
> Some time ago Zack mentioned that an option to suppress the warning might
> be useful. I agree; the itch I'm scratching is a bunch of really old code
> that we have to keep kicking along, and is riddled with things like this.
Ugh, if we have to. Can't you fix your code? A sed script should make
it a breeze. [I dislike the endless addition of switches to GCC, that's
all.]
> gcc:
> 2002-03-21 Phil Edwards <pme@gcc.gnu.org>
>
> * cpplib.h (struct cpp_options): New member, warn_endif_labels.
Should be unconditionally set to one in cpp_post_options if -pedantic.
[You can't set it when seeing -pedantic or -pedantic-errors, since there
might be a later -Wno-endif-labels which should be ignored.]
OK with that change.
Neil.