]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Make gnu89 support explicit
authorSteffan Karger <steffan@karger.me>
Fri, 16 Sep 2016 15:40:36 +0000 (17:40 +0200)
committerDavid Sommerseth <davids@openvpn.net>
Fri, 16 Sep 2016 16:33:59 +0000 (18:33 +0200)
In the release/2.3 branch we support gnu89, basically to keep
pre-2015 MSVC happy.  Old gcc (<5) defaulted to gnu89.  But
gcc 5+ and clang default to gnu11/c11.  This patch makes our
gnu89 support explicit, such these newer compilers will also
point out gnu89 violations to developers.

v2: only set -std=gnu89 if no -std flag is present in $CFLAGS

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: David Sommerseth <davids@openvpn.net>
Message-Id: 1474040436-9855-1-git-send-email-steffan@karger.me
URL: http://www.mail-archive.com/search?l=mid&q=1474040436-9855-1-git-send-email-steffan@karger.me
Signed-off-by: David Sommerseth <davids@openvpn.net>
configure.ac

index f83b03821b1b181cf8b36e9cf96d6ce47cbd5e18..faa49613599a7e23fdc59ebd99813aae1b6583fb 100644 (file)
@@ -1059,6 +1059,12 @@ if test "${enable_pkcs11}" = "yes"; then
        )
 fi
 
+# Set -std=gnu89 unless user already specified a -std=
+case "${CFLAGS}" in
+  *-std=*) ;;
+  *)       CFLAGS="${CFLAGS} -std=gnu89" ;;
+esac
+
 if test "${enable_pedantic}" = "yes"; then
        enable_strict="yes"
        CFLAGS="${CFLAGS} -pedantic"