mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Use -Wno-always-true only if $CC accepts it. GCC 4.1 doesn't.
This commit is contained in:
parent
d8ffd3b4b6
commit
67ee2205f3
19
configure.in
19
configure.in
@ -1413,13 +1413,28 @@ if test "x$ac_cv_prog_gcc" = "xyes"; then
|
|||||||
;;
|
;;
|
||||||
4.*)
|
4.*)
|
||||||
# Do not show warnings related to (char * | unsigned char *) type
|
# Do not show warnings related to (char * | unsigned char *) type
|
||||||
# difference. Do not show "always evaluate as true".
|
# difference.
|
||||||
CFLAGS="$CFLAGS -fno-strict-aliasing -Wno-pointer-sign -Wno-always-true"
|
CFLAGS="$CFLAGS -fno-strict-aliasing -Wno-pointer-sign"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# These should be ok using -Werror
|
# These should be ok using -Werror
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# GCC 4.2 snapshots warn that comparisons like &object != NULL
|
||||||
|
# always return true. Some macros in ELinks check whether pointer
|
||||||
|
# arguments are NULL, and giving them addresses of named objects
|
||||||
|
# triggers the warning. These warnings have not revealed any real
|
||||||
|
# bugs, so shut them up instead of complicating the code. GCC 4.1
|
||||||
|
# does not recognize -Wno-always-true and exits with code 1 if it is
|
||||||
|
# given.
|
||||||
|
AC_MSG_CHECKING([whether $CC accepts -Wno-always-true])
|
||||||
|
EL_SAVE_FLAGS
|
||||||
|
CFLAGS="$CFLAGS -Wno-always-true"
|
||||||
|
AC_TRY_COMPILE([], [],
|
||||||
|
[AC_MSG_RESULT([yes])],
|
||||||
|
[EL_RESTORE_FLAGS
|
||||||
|
AC_MSG_RESULT([no])])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
EL_LOG_CONFIG(CFLAGS, [Compiler flags (CFLAGS)], [])
|
EL_LOG_CONFIG(CFLAGS, [Compiler flags (CFLAGS)], [])
|
||||||
|
Loading…
Reference in New Issue
Block a user