summaryrefslogtreecommitdiff
path: root/m4/compiler_options.m4
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-07-12 10:23:35 +0200
committerThomas Haller <thaller@redhat.com>2018-07-17 17:46:39 +0200
commitb9bc20f4da12f15b8950daea177e6dda42cd6c3f (patch)
tree365474bde906ab0efb76172c74943f06a3db45e4 /m4/compiler_options.m4
parent00a523c4f3d4fc94d818f85699ef03a46c16e099 (diff)
downloadNetworkManager-b9bc20f4da12f15b8950daea177e6dda42cd6c3f.tar.gz
build: pass -std=gnu99 to compiler
With --enable-more-warnings, we already used -std=gnu99, see commit ba2b2de3adcf3e8286249523e3841858e0c2655c. Compilation may behave differently depending on the selected C standard that we choose. It seems wrong, with more-warnings, to build against a C standard, while otherwise leaving it undefind. Indeed, one might argue, that our build system should not use such compiler specific options. At least, not without detecting support for the compiler option during ./configure. However: - we already did this for --enable-more-warnings. - we should not program against a theoretical compiler. In practice, only gcc and clang works to build NetworkManager. Both these compilers support this option, so there is no reason to not use it. If we ever come into the situation to support another compiler, adjusting -std=gnu99 will be the smallest problem. Until that happens (and that's far from imminent), don't pretend to be portable to non-existing compilers and use the flag that in practice is available. See-also: https://gcc.gnu.org/onlinedocs/gcc/Standards.html
Diffstat (limited to 'm4/compiler_options.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 8a3a9c4f5f..ee1712ebfa 100644
--- a/m4/compiler_options.m4
+++ b/m4/compiler_options.m4
@@ -58,7 +58,7 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
dnl attach it to the CFLAGS.
NM_COMPILER_WARNING([$1], [unknown-warning-option], [])
- CFLAGS_MORE_WARNINGS="-Wall -std=gnu99"
+ CFLAGS_MORE_WARNINGS="-Wall"
if test "x$set_more_warnings" = xerror; then
CFLAGS_MORE_WARNINGS="$CFLAGS_MORE_WARNINGS -Werror"