summaryrefslogtreecommitdiffstats
path: root/src/configure.ac
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-04-14 14:37:07 +0200
committerBram Moolenaar <Bram@vim.org>2018-04-14 14:37:07 +0200
commit2e324950b83fcdf60843b54a6a339183370f338a (patch)
treec80a94cf7de8b07ad87c83d2188e83620df86cb0 /src/configure.ac
parent78a16b0f2a142aae1fdc96c50ab0f25194d0e755 (diff)
patch 8.0.1709: some non-C89 code may slip throughv8.0.1709
Problem: Some non-C89 code may slip through. Solution: Enforce C89 in configure. Fix detected problems. (James McCoy, closes #2735)
Diffstat (limited to 'src/configure.ac')
-rw-r--r--src/configure.ac13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/configure.ac b/src/configure.ac
index f2655a575d..27309b205d 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -11,7 +11,7 @@ AC_DEFINE(UNIX)
AC_PROG_MAKE_SET
dnl Checks for programs.
-AC_PROG_CC dnl required by almost everything
+AC_PROG_CC_C89 dnl required by almost everything
AC_PROG_CPP dnl required by header file checks
AC_PROGRAM_EGREP dnl required by AC_EGREP_CPP
AC_PROG_FGREP dnl finds working grep -F
@@ -61,6 +61,9 @@ if test "$GCC" = yes; then
CFLAGS="$CFLAGS -fno-strength-reduce"
fi
fi
+
+ dnl Declare what standards the code should comply with
+ CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700"
fi
dnl clang-500.2.75 or around has abandoned -f[no-]strength-reduce and issues a
@@ -135,7 +138,7 @@ AC_MSG_CHECKING([for Darwin (Mac OS X)])
if test "`(uname) 2>/dev/null`" = Darwin; then
AC_MSG_RESULT(yes)
MACOS_X=yes
- CPPFLAGS="$CPPFLAGS -DMACOS_X"
+ CPPFLAGS="$CPPFLAGS -D_DARWIN_C_SOURCE -DMACOS_X"
AC_MSG_CHECKING(--disable-darwin argument)
AC_ARG_ENABLE(darwin,
@@ -4400,6 +4403,12 @@ if test "$zOSUnix" = "yes"; then
CFLAGS="-D_ALL_SOURCE -Wc,float\(ieee\),dll"
fi
+dnl Declare what standards the code should comply with. But not when using
+dnl GTK, the header files cause all kinds of warnings.
+if test "$GCC" = yes -a "$GUITYPE" != "GTK"; then
+ CFLAGS="$CFLAGS -ansi"
+fi
+
dnl write output files
AC_OUTPUT(auto/config.mk:config.mk.in)