emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 24faf6b0 1/3: Don’t use -Woverride-init


From: Paul Eggert
Subject: [Emacs-diffs] master 24faf6b0 1/3: Don’t use -Woverride-init
Date: Wed, 5 Jul 2017 21:59:37 -0400 (EDT)

branch: master
commit 24faf6b0d2fe990e9334dd2e3238f749fec87897
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Don’t use -Woverride-init
    
    I have some further changes in mind that would also need to
    disable the -Woverride-init warnings.  In practice these warnings
    seem to be more trouble than they’re worth, so disable them in the
    cc command line.
    * configure.ac: Disable -Woverride-init here ...
    * src/bytecode.c: ... rather than here.
---
 configure.ac   |  5 ++++-
 src/bytecode.c | 12 ------------
 2 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/configure.ac b/configure.ac
index ef61107..980b4c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -957,6 +957,7 @@ AS_IF([test $gl_gcc_warnings = no],
   # This part is merely for shortening the command line,
   # since -Wno-FOO needs to be added below regardless.
   nw="$nw -Wmissing-field-initializers"
+  nw="$nw -Woverride-init"
   nw="$nw -Wtype-limits"
   nw="$nw -Wunused-parameter"
 
@@ -978,6 +979,7 @@ AS_IF([test $gl_gcc_warnings = no],
   done
   gl_WARN_ADD([-Wredundant-decls])     # Prefer this, as we don't use Bison.
   gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one
+  gl_WARN_ADD([-Wno-override-init])    # More trouble than it is worth
   gl_WARN_ADD([-Wno-sign-compare])     # Too many warnings for now
   gl_WARN_ADD([-Wno-type-limits])      # Too many warnings for now
   gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
@@ -1005,9 +1007,10 @@ AS_IF([test $gl_gcc_warnings = no],
   ])
  ])
 
-# clang is unduly picky about these regardless of whether
+# clang is picky about these regardless of whether
 # --enable-gcc-warnings is specified.
 if test "$emacs_cv_clang" = yes; then
+  gl_WARN_ADD([-Wno-initializer-overrides])
   gl_WARN_ADD([-Wno-tautological-compare])
   gl_WARN_ADD([-Wno-tautological-constant-out-of-range-compare])
 fi
diff --git a/src/bytecode.c b/src/bytecode.c
index e781a87..a473dfb 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -452,14 +452,6 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, 
Lisp_Object maxdepth,
         the table clearer.  */
 #define LABEL(OP) [OP] = &&insn_ ## OP
 
-#if GNUC_PREREQ (4, 6, 0)
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Woverride-init"
-#elif defined __clang__
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Winitializer-overrides"
-#endif
-
       /* This is the dispatch table for the threaded interpreter.  */
       static const void *const targets[256] =
        {
@@ -471,10 +463,6 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, 
Lisp_Object maxdepth,
 #undef DEFINE
        };
 
-#if GNUC_PREREQ (4, 6, 0) || defined __clang__
-# pragma GCC diagnostic pop
-#endif
-
 #endif
 
 



reply via email to

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