Change GCC mode from ISO C90 to ISO C99

Add GCC flag "-std=c99".  Also remove GCC flag "-ansi" which is an
alias for "-std=c90" and would make the flag "-std=c99" ineffective.
This fixes all occurrences of the following GCC warning:

warning: ISO C90 does not support '__func__' predefined identifier
merge-requests/1/head
Volker Diels-Grabsch 2015-12-05 21:33:48 +01:00 zatwierdzone przez Olaf Meeuwissen
rodzic baec5e0395
commit 58052a7ce6
2 zmienionych plików z 4 dodań i 20 usunięć

Wyświetl plik

@ -27,9 +27,11 @@ AC_DEFUN([SANE_SET_CFLAGS],
[
if test "${ac_cv_c_compiler_gnu}" = "yes"; then
NORMAL_CFLAGS="\
-std=c99 \
-W \
-Wall"
WARN_CFLAGS="\
-std=c99 \
-W \
-Wall \
-Wcast-align \
@ -41,16 +43,6 @@ if test "${ac_cv_c_compiler_gnu}" = "yes"; then
-Wstrict-prototypes \
-pedantic"
# Some platforms are overly strict with -ansi enabled. Exclude those.
ANSI_FLAG=-ansi
case "${host_os}" in
solaris* | hpux* | os2* | darwin* | cygwin* | mingw*)
ANSI_FLAG=
;;
esac
NORMAL_CFLAGS="${NORMAL_CFLAGS} ${ANSI_FLAG}"
WARN_CFLAGS="${WARN_CFLAGS} ${ANSI_FLAG}"
AC_ARG_ENABLE(warnings,
AC_HELP_STRING([--enable-warnings],
[turn on tons of compiler warnings (GCC only)]),

12
configure vendored
Wyświetl plik

@ -5185,9 +5185,11 @@ fi
if test "${ac_cv_c_compiler_gnu}" = "yes"; then
NORMAL_CFLAGS="\
-std=c99 \
-W \
-Wall"
WARN_CFLAGS="\
-std=c99 \
-W \
-Wall \
-Wcast-align \
@ -5199,16 +5201,6 @@ if test "${ac_cv_c_compiler_gnu}" = "yes"; then
-Wstrict-prototypes \
-pedantic"
# Some platforms are overly strict with -ansi enabled. Exclude those.
ANSI_FLAG=-ansi
case "${host_os}" in
solaris* | hpux* | os2* | darwin* | cygwin* | mingw*)
ANSI_FLAG=
;;
esac
NORMAL_CFLAGS="${NORMAL_CFLAGS} ${ANSI_FLAG}"
WARN_CFLAGS="${WARN_CFLAGS} ${ANSI_FLAG}"
# Check whether --enable-warnings was given.
if test "${enable_warnings+set}" = set; then :
enableval=$enable_warnings;