Avoid `long long' warnings with older gcc compilers. Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>. * 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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
diff --git a/ChangeLog b/ChangeLog
index f2b68a2..a6554f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2014-03-01 Werner Lemberg <wl@gnu.org>
+ Avoid `long long' warnings with older gcc compilers.
+ Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>.
+
+ * 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 <wl@gnu.org>
+
* docs/INSTALL.CROSS: Revised and updated.
2014-03-01 Werner Lemberg <wl@gnu.org>
diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw
index ca0048c..b13f671 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}"