From: Steffan Karger Date: Fri, 16 Sep 2016 15:40:36 +0000 (+0200) Subject: Make gnu89 support explicit X-Git-Tag: contains~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=130c27b1f24a33c77e01b2cf82c3427699153967;p=thirdparty%2Fopenvpn.git Make gnu89 support explicit 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 Acked-by: David Sommerseth 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 --- diff --git a/configure.ac b/configure.ac index f83b03821..faa496135 100644 --- a/configure.ac +++ b/configure.ac @@ -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"