lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 0c4c5b6 01/16: Improve gcc dialect defaults


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 0c4c5b6 01/16: Improve gcc dialect defaults
Date: Thu, 15 Nov 2018 17:37:02 -0500 (EST)

branch: master
commit 0c4c5b6f8a2f826636d94289ae4608e73d7405b6
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Improve gcc dialect defaults
    
    Formerly, C++1998 was specified as the default dialect, and then
    overridden for each successive gcc version since 2005. Now, the
    current dialect is the default. This make more sense because
     - it makes upgrading to a later gcc version easier; and
     - lmi actually does require the C++2017 dialect or later.
    
    Because contemporary lmi code can't even be built with older tools
    such as 2005's gcc-3.4.5, the overrides for such older tools are
    retained for historical reasons only; clearly C++2017 code cannot be
    built with a pre-C++2017 compiler, no matter what options are given.
    But it is useful to keep such history in current makefiles--e.g., a
    comment like:
      # Use a correct snprintf() implementation:
      #   http://article.gmane.org/gmane.comp.gnu.mingw.user/27539
      cxx_standard += -posix
    may come in handy someday if a problem with snprintf() arises and
    grepping the source for that function's name finds that comment readily.
    (Commands like 'git-grep', 'git-log --grep', and 'git-log -G' would of
    course find it even if it were deleted now, so this tradeoff accepts a
    little clutter in return for making the simpler command just work.)
---
 workhorse.make | 30 +++++++++++-------------------
 1 file changed, 11 insertions(+), 19 deletions(-)

diff --git a/workhorse.make b/workhorse.make
index 53e7471..7a07d41 100644
--- a/workhorse.make
+++ b/workhorse.make
@@ -359,10 +359,15 @@ physical_closure_files := \
 
 tutelary_flag :=
 
-# Warning options for gcc.
+# Dialect and warning options for gcc.
 
-c_standard   := -std=c99
-cxx_standard := -std=c++98
+# The default '-fno-rounding-math' means something like
+#   #pragma STDC FENV ACCESS OFF
+# which causes harm while bringing no countervailing benefit--see:
+#   http://lists.nongnu.org/archive/html/lmi/2017-08/msg00045.html
+
+c_standard   := -frounding-math -std=c99
+cxx_standard := -frounding-math -std=c++17
 
 # Specify $(gcc_version_specific_warnings) last, in order to override
 # other options.
@@ -371,6 +376,7 @@ ifeq (3.4.4,$(gcc_version))
   # Suppress spurious gcc-3.4.4 warnings:
   #   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22207
   gcc_version_specific_warnings := -Wno-uninitialized
+  cxx_standard := -std=c++98
 else ifeq (3.4.5,$(gcc_version))
   # Suppress spurious gcc-3.4.5 warnings:
   #   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22207
@@ -400,28 +406,14 @@ else ifneq (,$(filter $(gcc_version), 6.3.0))
     -Wno-conversion \
     -Wno-parentheses \
 
-  cxx_standard := -std=c++17
-
-# The default '-fno-rounding-math' means something like
-  #   #pragma STDC FENV ACCESS OFF
-  # which causes harm while bringing no countervailing benefit--see:
-  #   http://lists.nongnu.org/archive/html/lmi/2017-08/msg00045.html
-  c_standard   += -frounding-math
-  cxx_standard += -frounding-math
+  cxx_standard := -frounding-math -std=c++17
 else ifneq (,$(filter $(gcc_version), 7.2.0 7.3.0))
   # Rationale:
   # -Wno-parentheses [its diagnostics are beyond pedantic]
   gcc_version_specific_warnings := \
     -Wno-parentheses \
 
-  cxx_standard := -std=c++17
-
-# The default '-fno-rounding-math' means something like
-  #   #pragma STDC FENV ACCESS OFF
-  # which causes harm while bringing no countervailing benefit--see:
-  #   http://lists.nongnu.org/archive/html/lmi/2017-08/msg00045.html
-  c_standard   += -frounding-math
-  cxx_standard += -frounding-math
+  cxx_standard := -frounding-math -std=c++17
 endif
 
 treat_warnings_as_errors := -pedantic-errors -Werror



reply via email to

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