mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Require C99 (and thus MSCV 2013 upwards).
In 86d78ef50e
I enabled configure to check for C99 support, with the
goal of checking which platforms support C99. While there are a few
machines without C99 support among our buildfarm animals,
de-supporting them for v12 was deemed acceptable.
While not tested in aforementioned commit, the biggest increase in
minimum compiler version comes from MSVC, which gained C99 support
fairly late. The subset in MSVC 2013 is sufficient for our needs, at
this point. While that is a significant increase in minimum version,
the existing windows binaries are already built with a new enough
version.
Make configure error out if C99 support could not be detected. For
MSVC builds, increase the minimum version to 2013.
The increase to MSVC 2013 allows us to get rid of VCBuildProject.pm,
as that was only required for MSVC 2005/2008.
Author: Andres Freund
Discussion: https://postgr.es/m/97d4b165-192d-3605-749c-f614a0c4e783@2ndquadrant.com
This commit is contained in:
49
configure
vendored
49
configure
vendored
@ -4602,6 +4602,13 @@ if test "x$ac_cv_prog_cc_c99" != xno; then :
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Error out if the compiler does not support C99, as the codebase
|
||||
# relies on that.
|
||||
if test "$ac_cv_prog_cc_c99" = no; then
|
||||
as_fn_error $? "C compiler \"$CC\" does not support C99" "$LINENO" 5
|
||||
fi
|
||||
|
||||
ac_ext=cpp
|
||||
ac_cpp='$CXXCPP $CPPFLAGS'
|
||||
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
@ -5361,6 +5368,48 @@ fi
|
||||
|
||||
|
||||
# -Wdeclaration-after-statement isn't applicable for C++
|
||||
# Really don't want VLAs to be used in our dialect of C
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Werror=vla, for CFLAGS" >&5
|
||||
$as_echo_n "checking whether ${CC} supports -Werror=vla, for CFLAGS... " >&6; }
|
||||
if ${pgac_cv_prog_CC_cflags__Werror_vla+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
pgac_save_CFLAGS=$CFLAGS
|
||||
pgac_save_CC=$CC
|
||||
CC=${CC}
|
||||
CFLAGS="${CFLAGS} -Werror=vla"
|
||||
ac_save_c_werror_flag=$ac_c_werror_flag
|
||||
ac_c_werror_flag=yes
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
pgac_cv_prog_CC_cflags__Werror_vla=yes
|
||||
else
|
||||
pgac_cv_prog_CC_cflags__Werror_vla=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
ac_c_werror_flag=$ac_save_c_werror_flag
|
||||
CFLAGS="$pgac_save_CFLAGS"
|
||||
CC="$pgac_save_CC"
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Werror_vla" >&5
|
||||
$as_echo "$pgac_cv_prog_CC_cflags__Werror_vla" >&6; }
|
||||
if test x"$pgac_cv_prog_CC_cflags__Werror_vla" = x"yes"; then
|
||||
CFLAGS="${CFLAGS} -Werror=vla"
|
||||
fi
|
||||
|
||||
|
||||
# -Wvla is not applicable for C++
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wendif-labels, for CFLAGS" >&5
|
||||
$as_echo_n "checking whether ${CC} supports -Wendif-labels, for CFLAGS... " >&6; }
|
||||
|
Reference in New Issue
Block a user