bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] manywarnings: port to GCC 8.0


From: Paul Eggert
Subject: [PATCH] manywarnings: port to GCC 8.0
Date: Sat, 28 Apr 2018 13:55:32 -0700

* build-aux/gcc-warning.spec: Add -Wcatch-value,
-Wclass-memaccess, -Wdo-subscript, -Wextra-semi.  Adjust to the
fact that the GCC help message now mentions operands for
-Warray-bounds, -Wformat, -Wformat-overflow, -Wformat-truncation,
-Wimplicit-fallthrough, -Wplacement-new, -Wshift-overflow,
-Wstrict-aliasing, -Wstrict-overflow, -Wstringop-overflow,
and -Wunused-const-variable.
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -Wattribute-alias,
-Wcast-align=strict, -Wcast-function-type, -Wif-not-aligned,
-Wmissing-attributes, -Wmultistatement-macros,
-Wpacked-not-aligned, -Wsizeof-pointer-div, -Wstringop-truncation,
-Wsuggest-attribute=cold, -Wsuggest-attribute=malloc.
---
 ChangeLog                  | 16 ++++++++++++++++
 build-aux/gcc-warning.spec | 30 +++++++++++++++++-------------
 m4/manywarnings.m4         | 20 +++++++++++++++-----
 3 files changed, 48 insertions(+), 18 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9f809cce8..1ef9799f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2018-04-27  Paul Eggert  <address@hidden>
+
+       manywarnings: port to GCC 8.0
+       * build-aux/gcc-warning.spec: Add -Wcatch-value,
+       -Wclass-memaccess, -Wdo-subscript, -Wextra-semi.  Adjust to the
+       fact that the GCC help message now mentions operands for
+       -Warray-bounds, -Wformat, -Wformat-overflow, -Wformat-truncation,
+       -Wimplicit-fallthrough, -Wplacement-new, -Wshift-overflow,
+       -Wstrict-aliasing, -Wstrict-overflow, -Wstringop-overflow,
+       and -Wunused-const-variable.
+       * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -Wattribute-alias,
+       -Wcast-align=strict, -Wcast-function-type, -Wif-not-aligned,
+       -Wmissing-attributes, -Wmultistatement-macros,
+       -Wpacked-not-aligned, -Wsizeof-pointer-div, -Wstringop-truncation,
+       -Wsuggest-attribute=cold, -Wsuggest-attribute=malloc.
+
 2018-04-24  Bruno Haible  <address@hidden>
 
        sys_socket: Make SO_REUSEPORT available across platforms.
diff --git a/build-aux/gcc-warning.spec b/build-aux/gcc-warning.spec
index 9b9c39faf..2ffdb2ba4 100644
--- a/build-aux/gcc-warning.spec
+++ b/build-aux/gcc-warning.spec
@@ -6,7 +6,6 @@
 -Waggregate-return                     obsolescent
 -Waliasing                             fortran
 -Walign-commons                                fortran
--Waligned-new                          c++
 -Waligned-new=[none|global|all]                c++
 -Walloca                               we like alloca in small doses
 -Walloca-larger-than=<number>          FIXME: choose something sane?
@@ -15,7 +14,7 @@
 -Wampersand                            fortran
 -Wargument-mismatch                    fortran
 -Warray-bounds                         covered by -Warray-bounds=
--Warray-bounds=                                handled specially by 
gl_MANYWARN_ALL_GCC
+-Warray-bounds=<0,2>                   handled specially by gl_MANYWARN_ALL_GCC
 -Warray-temporaries                    fortran
 -Wassign-intercept                     objc/objc++
 -Wc++-compat                           FIXME maybe? borderline.  some will 
want this
@@ -28,7 +27,10 @@
 -Wc90-c99-compat                       c compatibility
 -Wc99-c11-compat                       c compatibility
 -Wcast-qual                            FIXME maybe? too much noise; encourages 
bad changes
+-Wcatch-value                          c++
+-Wcatch-value=<0,3>                    c++
 -Wcharacter-truncation                 fortran
+-Wclass-memaccess                      c++
 -Wcompare-reals                                fortran
 -Wconditionally-supported              c++ and objc++
 -Wconversion                           FIXME maybe? too much noise; encourages 
bad changes
@@ -38,20 +40,22 @@
 -Wdeclaration-after-statement          FIXME: do not want.  others may
 -Wdelete-incomplete                    c++ and objc++
 -Wdelete-non-virtual-dtor              c++
+-Wdo-subscript                         fortran
 -Weffc++                               c++
 -Werror-implicit-function-declaration  deprecated
+-Wextra-semi                           c++
 -Wfloat-conversion                     FIXME maybe? borderline.  some will 
want this
 -Wfloat-equal                          FIXME maybe? borderline.  some will 
want this
 -Wformat                               covered by -Wformat=2
--Wformat=                              gcc --help=warnings artifact
--Wformat-overflow                      covered by -Wformat-overflow=2
--Wformat-overflow=                     handled specially by gl_MANYWARN_ALL_GCC
+-Wformat=<0,2>                         gcc --help=warnings artifact
+-Wformat-overflow<0,2>                 gcc --help=warnings artifact
+-Wformat-overflow=<0,2>                        handled specially by 
gl_MANYWARN_ALL_GCC
 -Wformat-truncation                    covered by -Wformat-truncation=2
--Wformat-truncation=                   handled specially by gl_MANYWARN_ALL_GCC
+-Wformat-truncation=<0,2>              handled specially by gl_MANYWARN_ALL_GCC
 -Wframe-larger-than=<number>           FIXME: choose something sane?
 -Wfunction-elimination                 fortran
 -Wimplicit-fallthrough                 covered by -Wimplicit-fallthrough=2
--Wimplicit-fallthrough=                        handled specially by 
gl_MANYWARN_ALL_GCC
+-Wimplicit-fallthrough=<0,5>           handled specially by gl_MANYWARN_ALL_GCC
 -Wimplicit-interface                   fortran
 -Wimplicit-procedure                   fortran
 -Winherited-variadic-ctor              c++
@@ -81,7 +85,7 @@
 -Wpadded                               FIXME maybe?  warns about "stabil" 
member in /usr/include/bits/timex.h
 -Wpedantic                             FIXME: too strict?
 -Wplacement-new                                c++
--Wplacement-new=                       c++
+-Wplacement-new=<0,2>                  c++
 -Wpmf-conversions                      c++ and objc++
 -Wproperty-assign-default              objc++
 -Wprotocol                             objc++
@@ -99,18 +103,18 @@
 -Wshadow=local                         covered by -Wshadow
 -Wshadow-local                         covered by -Wshadow
 -Wshift-overflow                       covered by -Wshift-overflow=2
--Wshift-overflow=                      gcc --help=warnings artifact
+-Wshift-overflow=<0,2>                 gcc --help=warnings artifact
 -Wsign-compare                         FIXME maybe? borderline.  some will 
want this
 -Wsign-conversion                      FIXME maybe? borderline.  some will 
want this
 -Wsign-promo                           c++ and objc++
 -Wsized-deallocation                   c++ and objc++
 -Wstack-usage=<number>                 FIXME: choose something sane?
--Wstrict-aliasing=                     FIXME: choose something sane?
+-Wstrict-aliasing=<0,3>                        FIXME: choose something sane?
 -Wstrict-null-sentinel                 c++ and objc++
--Wstrict-overflow=                     FIXME: choose something sane?
+-Wstrict-overflow=<0,5>                        FIXME: choose something sane?
 -Wstrict-selector-match                        objc and objc++
 -Wstringop-overflow                    covered by -Wstringop-overflow=
--Wstringop-overflow=                   handled specially by gl_MANYWARN_ALL_GCC
+-Wstringop-overflow=<0,4>              handled specially by gl_MANYWARN_ALL_GCC
 -Wsubobject-linkage                    c++ and objc++
 -Wsuggest-override                     c++ and objc++
 -Wsurprising                           fortran
@@ -129,7 +133,7 @@
 -Wunreachable-code                     obsolescent no-op
 -Wunsuffixed-float-constants           triggers warning in gnulib's timespec.h
 -Wunused-const-variable                        covered by 
-Wunusec-const-variable=2
--Wunused-const-variable=               gcc --help=warnings artifact
+-Wunused-const-variable=<0,2>          gcc --help=warnings artifact
 -Wunused-dummy-argument                        fortran
 -Wuse-without-only                     fortran
 -Wuseless-cast                         c++ and objc++
diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4
index 18249b8f2..60c0e4051 100644
--- a/m4/manywarnings.m4
+++ b/m4/manywarnings.m4
@@ -1,4 +1,4 @@
-# manywarnings.m4 serial 13
+# manywarnings.m4 serial 14
 dnl Copyright (C) 2008-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -106,10 +106,9 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
   # To compare this list to your installed GCC's, run this Bash command:
   #
   # comm -3 \
-  #  <(sed -n 's/^  *\(-[^ 0-9][^ ]*\) .*/\1/p' manywarnings.m4 | sort) \
-  #  <(gcc --help=warnings | sed -n 's/^  \(-[^ ]*\) .*/\1/p' | sort |
-  #      grep -v -x -F -f <(
-  #         awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec))
+  #  <((sed -n 's/^  *\(-[^ 0-9][^ ]*\) .*/\1/p' manywarnings.m4; \
+  #     awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec) | sort) \
+  #  <(gcc --help=warnings | sed -n 's/^  \(-[^ ]*\) .*/\1/p' | sort)
 
   gl_manywarn_set=
   for gl_manywarn_item in -fno-common \
@@ -118,6 +117,7 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
     -Waddress \
     -Waggressive-loop-optimizations \
     -Wall \
+    -Wattribute-alias \
     -Wattributes \
     -Wbad-function-cast \
     -Wbool-compare \
@@ -125,6 +125,8 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
     -Wbuiltin-declaration-mismatch \
     -Wbuiltin-macro-redefined \
     -Wcast-align \
+    -Wcast-align=strict \
+    -Wcast-function-type \
     -Wchar-subscripts \
     -Wchkp \
     -Wclobbered \
@@ -160,6 +162,7 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
     -Wframe-address \
     -Wfree-nonheap-object \
     -Whsa \
+    -Wif-not-aligned \
     -Wignored-attributes \
     -Wignored-qualifiers \
     -Wimplicit \
@@ -181,6 +184,7 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
     -Wmemset-elt-size \
     -Wmemset-transposed-args \
     -Wmisleading-indentation \
+    -Wmissing-attributes \
     -Wmissing-braces \
     -Wmissing-declarations \
     -Wmissing-field-initializers \
@@ -188,6 +192,7 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
     -Wmissing-parameter-type \
     -Wmissing-prototypes \
     -Wmultichar \
+    -Wmultistatement-macros \
     -Wnarrowing \
     -Wnested-externs \
     -Wnonnull \
@@ -202,6 +207,7 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
     -Woverride-init \
     -Wpacked \
     -Wpacked-bitfield-compat \
+    -Wpacked-not-aligned \
     -Wparentheses \
     -Wpointer-arith \
     -Wpointer-compare \
@@ -219,13 +225,17 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
     -Wshift-count-overflow \
     -Wshift-negative-value \
     -Wsizeof-array-argument \
+    -Wsizeof-pointer-div \
     -Wsizeof-pointer-memaccess \
     -Wstack-protector \
     -Wstrict-aliasing \
     -Wstrict-overflow \
     -Wstrict-prototypes \
+    -Wstringop-truncation \
+    -Wsuggest-attribute=cold \
     -Wsuggest-attribute=const \
     -Wsuggest-attribute=format \
+    -Wsuggest-attribute=malloc \
     -Wsuggest-attribute=noreturn \
     -Wsuggest-attribute=pure \
     -Wsuggest-final-methods \
-- 
2.17.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]