This is the mail archive of the 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

"Manuel LÃpez-IbÃÃez" <> 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

> 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.


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