mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-04 08:17:17 -05:00
GCC 4.2.1 needs -Wno-address, not -Wno-always-true.
[ Backported from ELinks 0.12.GIT. The 0.11 branch is still using older Autoconf macros. ]
This commit is contained in:
parent
8165e85d82
commit
fa20852ce2
32
configure.in
32
configure.in
@ -1318,20 +1318,24 @@ if test "x$ac_cv_prog_gcc" = "xyes"; then
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# GCC 4.2 snapshots warn that comparisons like &object != NULL
|
# GCC 4.2.1 warns if we use the address of an object in Boolean context:
|
||||||
# always return true. Some macros in ELinks check whether pointer
|
# warning: the address of `builtin_modules' will always evaluate as `true'
|
||||||
# arguments are NULL, and giving them addresses of named objects
|
# This hits the object_lock and foreach_module macros in particular.
|
||||||
# triggers the warning. These warnings have not revealed any real
|
# It would be okay to put something in the macros to avoid the warning,
|
||||||
# bugs, so shut them up instead of complicating the code. GCC 4.1
|
# but currently this seems to require defining parallel macros that skip
|
||||||
# does not recognize -Wno-always-true and exits with code 1 if it is
|
# the NULL check, and that's too ugly. So we instead disable the warning.
|
||||||
# given.
|
# GCC 4.2.1 needs -Wno-address, but GCC 4.2 snapshots need -Wno-always-true.
|
||||||
AC_MSG_CHECKING([whether $CC accepts -Wno-always-true])
|
# GCC 4.1.3 recognizes neither and exits with code 1 if they are given.
|
||||||
EL_SAVE_FLAGS
|
for warning_flag in -Wno-address -Wno-always-true; do
|
||||||
CFLAGS="$CFLAGS -Wno-always-true"
|
AC_MSG_CHECKING([whether $CC accepts $warning_flag])
|
||||||
AC_TRY_COMPILE([], [],
|
EL_SAVE_FLAGS
|
||||||
[AC_MSG_RESULT([yes])],
|
CFLAGS="$CFLAGS $warning_flag"
|
||||||
[EL_RESTORE_FLAGS
|
AC_TRY_COMPILE([], [],
|
||||||
AC_MSG_RESULT([no])])
|
[AC_MSG_RESULT([yes])
|
||||||
|
break],
|
||||||
|
[AC_MSG_RESULT([no])])
|
||||||
|
EL_RESTORE_FLAGS
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# CFLAGS doesn't contain all compile flags. Some will be added only when
|
# CFLAGS doesn't contain all compile flags. Some will be added only when
|
||||||
|
Loading…
Reference in New Issue
Block a user