From e962a914fdee0e442c3a3da8650edf0c04f1dae4 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Sat, 1 Mar 2014 21:00:02 +0100 Subject: [PATCH] Avoid `long long' warnings with older gcc compilers. Problem reported by Hin-Tak Leung . * builds/unix/configure.raw: Don't use gcc's `-pedantic' flag for versions < 4.6. This is especially needed for Max OS X since this OS runs a gcc variant (or emulation) based on version 4.2.1. --- ChangeLog | 9 +++++++++ builds/unix/configure.raw | 21 ++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f2b68a261..a6554f49b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2014-03-01 Werner Lemberg + + Avoid `long long' warnings with older gcc compilers. + Problem reported by Hin-Tak Leung . + + * builds/unix/configure.raw: Don't use gcc's `-pedantic' flag for + versions < 4.6. This is especially needed for Max OS X since this + OS runs a gcc variant (or emulation) based on version 4.2.1. + 2014-03-01 Werner Lemberg * docs/INSTALL.CROSS: Revised and updated. diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw index ca0048ca2..b13f67193 100644 --- a/builds/unix/configure.raw +++ b/builds/unix/configure.raw @@ -216,6 +216,12 @@ AC_CHECK_FUNCS([memcpy memmove]) # # Due to bugs in mingwrt 4.0.3 we don't use `-ansi' for MinGW. # +# To avoid zillions of +# +# ISO C90 does not support 'long long' +# +# warnings, we disable `-pedantic' for gcc version < 4.6. +# if test "x$GCC" = xyes; then XX_CFLAGS="-Wall" case "$host" in @@ -223,8 +229,21 @@ if test "x$GCC" = xyes; then XX_ANSIFLAGS="-pedantic" ;; *) + GCC_VERSION=`$CC -dumpversion` + GCC_MAJOR=`echo "$GCC_VERSION" | sed 's/\([[^.]][[^.]]*\).*/\1/'` + GCC_MINOR=`echo "$GCC_VERSION" | sed 's/[[^.]][[^.]]*.\([[^.]][[^.]]*\).*/\1/'` + + XX_PEDANTIC=-pedantic + if test $GCC_MAJOR -lt 4; then + XX_PEDANTIC= + else + if test $GCC_MAJOR -eq 4 -a $GCC_MINOR -lt 6; then + XX_PEDANTIC= + fi + fi + XX_ANSIFLAGS="" - for a in -pedantic -ansi + for a in $XX_PEDANTIC -ansi do AC_MSG_CHECKING([gcc compiler flag ${a} to assure ANSI C works correctly]) orig_CFLAGS="${CFLAGS}"