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: [PATCH] cpplib: -Wno-endif-labels


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.


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