mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-23 20:03:31 +01:00
Only use -Wlogical-op with GCC 4.6 and later
It generates an apparently spurious warning with gcc 4.4 in debian; we haven't tested 4.5.
This commit is contained in:
parent
d3420e7e73
commit
4c6081910d
16
configure.ac
16
configure.ac
@ -1446,6 +1446,12 @@ if test x$enable_gcc_warnings = xyes || test x$enable_gcc_warnings_advisory = xy
|
|||||||
#error
|
#error
|
||||||
#endif])], have_gcc43=yes, have_gcc43=no)
|
#endif])], have_gcc43=yes, have_gcc43=no)
|
||||||
|
|
||||||
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
|
||||||
|
#if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)
|
||||||
|
#error
|
||||||
|
#endif])], have_gcc46=yes, have_gcc46=no)
|
||||||
|
|
||||||
|
|
||||||
save_CFLAGS="$CFLAGS"
|
save_CFLAGS="$CFLAGS"
|
||||||
CFLAGS="$CFLAGS -Wshorten-64-to-32"
|
CFLAGS="$CFLAGS -Wshorten-64-to-32"
|
||||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], have_shorten64_flag=yes,
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], have_shorten64_flag=yes,
|
||||||
@ -1494,13 +1500,21 @@ if test x$enable_gcc_warnings = xyes || test x$enable_gcc_warnings_advisory = xy
|
|||||||
if test x$have_gcc43 = xyes ; then
|
if test x$have_gcc43 = xyes ; then
|
||||||
# These warnings break gcc 4.2 and work on gcc 4.3
|
# These warnings break gcc 4.2 and work on gcc 4.3
|
||||||
# XXXX020 See if any of these work with earlier versions.
|
# XXXX020 See if any of these work with earlier versions.
|
||||||
CFLAGS="$CFLAGS -Wextra -Warray-bounds -Wlogical-op"
|
CFLAGS="$CFLAGS -Wextra -Warray-bounds"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test x$have_gcc46 = xyes ; then
|
||||||
|
# This warning was added in gcc 4.3, but it appears to generate
|
||||||
|
# spurious warnings in gcc 4.4. I don't know if it works in 4.5.
|
||||||
|
CFLAGS="$CFLAGS -Wlogical-op"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test x$have_shorten64_flag = xyes ; then
|
if test x$have_shorten64_flag = xyes ; then
|
||||||
CFLAGS="$CFLAGS -Wshorten-64-to-32"
|
CFLAGS="$CFLAGS -Wshorten-64-to-32"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
##This will break the world on some 64-bit architectures
|
##This will break the world on some 64-bit architectures
|
||||||
# CFLAGS="$CFLAGS -Winline"
|
# CFLAGS="$CFLAGS -Winline"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user