summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-11-10 08:28:39 +0100
committerThomas Haller <thaller@redhat.com>2016-11-10 09:34:39 +0100
commit2075fc79d58225ee8425b5502cd212a747631422 (patch)
tree35f8c890dab309115f56501a2e93d4aacd660294 /m4
parent1272786ea865afb53c476ae3b43cb4651694299d (diff)
build: allow using GCC C99 dialect instead of C89
We already use several GCC extenions, like typeof() and __attribute__((cleanup)). They are too convinient to miss and every supported compiler must support these. Currently, gcc and clang does. Maybe other compilers would support that too, but who knows, nobody seems to test that. We also already use stdbool.h (C99) and the imported systemd code is mostly gnu99 too (it's not clear to me, because I don't find it precisely documented. Certainly it makes use of C99 features too). C99/gnu99 has some nice improvements that we no longer should miss out. For example "flexible array members" or "variable declaration in init-part of for loop". It doesn't mean we have to use every obscure (badly supported?) feature, it means we don't have to forgo features that are well supported. C99 is 17 years old, I mean, really... If somebody comes along and ports NM to non-gcc/clang, we can address bugs about unsupported language features as they surface. But let's not restrict us to some hypothetical compiler (or language specification). Also, NetworkManager is not ported on environment beside Linux. We don't have to be so considerate about the required build environment. Gcc is probably the most portable compiler out there. I doubt porting NetworkManager to *BSD fails due to missing gnu99 features. And if that causes issues, we should fix them after they happen in practice.
Diffstat (limited to 'm4')
-rw-r--r--m4/compiler_options.m42
1 files changed, 1 insertions, 1 deletions
diff --git a/m4/compiler_options.m4 b/m4/compiler_options.m4
index fa11c522e..ad03200a5 100644
--- a/m4/compiler_options.m4
+++ b/m4/compiler_options.m4
@@ -55,7 +55,7 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
dnl attach it to the CFLAGS.
NM_COMPILER_WARNING([unknown-warning-option], [])
- CFLAGS_MORE_WARNINGS="-Wall -std=gnu89"
+ CFLAGS_MORE_WARNINGS="-Wall -std=gnu99"
if test "x$set_more_warnings" = xerror; then
CFLAGS_MORE_WARNINGS="$CFLAGS_MORE_WARNINGS -Werror"