enumerate explicitly what is enabled by Wall

Manuel López-Ibáñez lopezibanez@gmail.com
Sun Sep 30 22:16:00 GMT 2007

On 30/09/2007, Gerald Pfeifer <gerald@pfeifer.com> wrote:
> On Sun, 23 Sep 2007, Manuel López-Ibáñez wrote:
> > With the current text in invoke.texi, it is sometimes difficult to
> > tell which options are enabled by Wall. This would be easier if we
> > followed the approach for describing -OX, as this patch implements. I
> > have also reviewed all the flags actually enabled by Wall in the code.
> This certainly brings some nice benefits.  There is, however, one use
> case that I am worried about us losing by this change:  When I started
> to use GCC, and a few times thereafter, I went through the list of all
> options below the -Wall description to see whether to explicitly add
> some. Recently, in GCC terms ;-), a kind volunteer added a reference to
> -Wall to relevant options.  Are you confident this list is correct?  In
> that case, consider my comment moot, and this part of the patch is fine.

Sorry, I cannot understand what you mean. Could you elaborate a bit
further? I went to gcc/c-opts.c and checked that the list of options
is correct.

Actually, I have this little patch that is neutral (do not change
behaviour), bootstrapped and regression tested. I didn't submit it
because we are in stage3, but perhaps an exception can be made here.

2007-09-30  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

 * c-opts.c(c_common_handle_option): -Wnontemplate-friend,
-Wwrite-strings and -Wmultichar are enabled by default, so Wall
enabling them is redundant. Don't check two times for c_dialect_cxx.

Index: gcc/c-opts.c
--- gcc/c-opts.c        (revision 128662)
+++ gcc/c-opts.c        (working copy)
@@ -400,8 +400,6 @@
       warn_parentheses = value;
       warn_return_type = value;
       warn_sequence_point = value;     /* Was C only.  */
-      if (c_dialect_cxx ())
-       warn_sign_compare = value;
       warn_switch = value;
       set_Wstrict_aliasing (value);
       warn_address = value;
@@ -425,17 +423,14 @@
          /* C++-specific warnings.  */
+          warn_sign_compare = value;
          warn_reorder = value;
-         warn_nontemplate_friend = value;
           warn_cxx0x_compat = value;
-          if (value > 0)
-            warn_write_strings = true;

       cpp_opts->warn_trigraphs = value;
       cpp_opts->warn_comments = value;
       cpp_opts->warn_num_sign_change = value;
-      cpp_opts->warn_multichar = value;        /* Was C++ only.  */

       if (warn_pointer_sign == -1)
        warn_pointer_sign = 1;

> Your patch also moves -Wfatal-errors which is not listed in the ChangeLog.
> Is this change intentional, or ment to be separate?

It didn't make sense to me to move Wall before Wfatal-errors. But I
will submit that change separately.

> Please, also note your fixing of @option{-Wstrict-aliasing=3} in the
> ChangeLog.





More information about the Gcc-patches mailing list