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.
This commit is contained in:
Werner Lemberg 2014-03-01 21:00:02 +01:00
parent 476a76650b
commit e962a914fd
2 changed files with 29 additions and 1 deletions

View File

@ -1,3 +1,12 @@
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.

View File

@ -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}"