[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
- [lmi-commits] [lmi] master updated (dd60056 -> 89e939b), Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master 08e2d4c 03/16: Truncate sizeof(char*), Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master 327d53c 06/16: Conditionally suppress selected x86_64-linux-gnu gcc-8 diagnostics, Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master a1c1aa0 11/16: Avoid type 'long int', Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master 158c2a1 08/16: Suppress x86_64-linux-gnu gcc-8 diagnostics for xmlwrapp, Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master db0c484 02/16: Improve default gcc warning options, Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master d425a61 10/16: Suppress some 86_64-linux-gnu gcc-8 '-Wconversion' diagnostics, Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master 9c34f2a 12/16: Don't mix std::size_t with fixed-width integer types, Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master 89e939b 16/16: Prefer lmi::ssize() to member size(), Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master 0c4c5b6 01/16: Improve gcc dialect defaults,
Greg Chicares <=
- [lmi-commits] [lmi] master 96dc6f5 07/16: Suppress certain diagnostics for another old boost library, Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master 5548922 14/16: Avoid gratuitous use of member size(), Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master fc8cf69 13/16: Prefer lmi::ssize() to member size(); rewrite a function out of line, Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master f0fd0dc 15/16: Use bourn_cast to convert arithmetic types safely, Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master c0a4dde 04/16: Reliably multiply suseconds_t by double, Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master 0d09e74 05/16: Make a macro definition conditional, Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master a00f295 09/16: Avoid std::ptrdiff_t where it's excessively wide for 64-bit builds, Greg Chicares, 2018/11/15