lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 2d6a27f6 6/6: Explicitly enable '-Wpedantic'


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 2d6a27f6 6/6: Explicitly enable '-Wpedantic' for gcc
Date: Sun, 10 Jul 2022 12:07:57 -0400 (EDT)

branch: master
commit 2d6a27f678207604bd60866312067e99e2d777cb
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Explicitly enable '-Wpedantic' for gcc
    
    Commit 1a2c6b496fbf1 of 20051031T0342Z replaced three flags with two:
      -  -pedantic \
      -  -pedantic-errors \
      -  -Werror \
      +treat_warnings_as_errors := -pedantic-errors -Werror
    evidently in the belief that '-pedantic-errors' implies '-pedantic'.
    The gcc documentation suggests otherwise:
    
      https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
    | -pedantic-errors ... is not equivalent to -Werror=pedantic, since
    | there are errors enabled by this option and not enabled by the
    | latter and vice versa. ...
    | -Werror=switch turns the warnings controlled by -Wswitch into errors.
    | ... -Werror=foo automatically implies -Wfoo.
    
    It says, therefore, that there are errors enabled by '-Wpedantic' that
    are not enabled by '-pedantic-errors', even though
      make show_overlooked_cxx_warnings
    suggests otherwise. Added '-Wpedantic' anyway because it's harmless even
    if redundant.
    
    The documentation lists '-Wpedantic' and '-pedantic' together, with a
    common definition, so those two must be equivalent. Apparently the '-W'
    alias was introduced in gcc-4.8 or so.
---
 compiler_gcc_warnings.make | 1 +
 1 file changed, 1 insertion(+)

diff --git a/compiler_gcc_warnings.make b/compiler_gcc_warnings.make
index d2ed5fd2..e6535d9f 100644
--- a/compiler_gcc_warnings.make
+++ b/compiler_gcc_warnings.make
@@ -99,6 +99,7 @@ gcc_common_warnings := \
   -Wmultichar \
   -Wnull-dereference \
   -Wpacked \
+  -Wpedantic \
   -Wpointer-arith \
   -Wredundant-decls \
   -Wrestrict \



reply via email to

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