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: PR7651 Define -Wextra strictly in terms of other warning flags


On 15 Dec 2006 08:47:05 -0800, Ian Lance Taylor <iant@google.com> wrote:
"Manuel LÃpez-IbÃÃez" <lopezibanez@gmail.com> writes:

> The following patch is a little step towards that goal. It adds a new
> option -Wempty-body that takes over the function of warning for an
> empty body occurring in an if or else statement. The new option is
> enabled by -Wextra, so we keep the current behaviour but add the
> ability to enable/disable this individual warning.

I think this is in general a good idea, although I can't approve the
patch.

This is just the first step, I intend to add options for all Wextra warnings, so all of them can be individually turned off and then close PR7651. I hope I still have your support ;-)

> Index: gcc/doc/invoke.texi
> ===================================================================
> --- gcc/doc/invoke.texi       (revision 119813)
> +++ gcc/doc/invoke.texi       (working copy)
> @@ -2916,7 +2916,8 @@ void foo(bar) @{ @}
>  @end smallexample
>
>  @item
> -An empty body occurs in an @samp{if} or @samp{else} statement.
> +An empty body occurs in an @samp{if} or @samp{else} statement. This
> +warning can be independently controlled by @option{-Wempty-body}.

I think you should make a separate entry in the list for -Wempty-body,
and then say that -Wextra turns it on.  Ideally each warning should
have its own @item and @opindex in the full list of warnings.

I completely agree. I was planning to submit another proposal (and a patch!!) once I finished cleaning up Wextra but yes, I could do that for each new option. Thanks for looking at this!

So, someone that can approve the patch, is it OK with the changes
mentioned by Ian or should I submit a new version implementing those
changes?

Cheers,

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