mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Make gcc warnings on by default, and --enable-gcc-warnings only add -Werror
This commit is based on a patch for Tor (git commit ca60a6ce3f4786626ac455ec1b798b2e8304635c by Peter Palfrader), Copyright (c) 2007-2011, The Tor Project, Inc. (Originally, it added --enable-gcc-warnings-advisory as in Tor; Nick changed that.)
This commit is contained in:
parent
7889c43ef8
commit
d46517ee55
12
configure.in
12
configure.in
@ -54,7 +54,9 @@ if test "$GCC" = "yes" ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
AC_ARG_ENABLE(gcc-warnings,
|
AC_ARG_ENABLE(gcc-warnings,
|
||||||
AS_HELP_STRING(--enable-gcc-warnings, enable verbose warnings with GCC))
|
AS_HELP_STRING(--disable-gcc-warnings, disable verbose warnings with GCC))
|
||||||
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(thread-support,
|
AC_ARG_ENABLE(thread-support,
|
||||||
AS_HELP_STRING(--disable-thread-support, disable support for threading),
|
AS_HELP_STRING(--disable-thread-support, disable support for threading),
|
||||||
[], [enable_thread_support=yes])
|
[], [enable_thread_support=yes])
|
||||||
@ -623,7 +625,7 @@ AM_CONDITIONAL(OPENSSL, [test "$enable_openssl" != "no" && test "$have_openssl"
|
|||||||
|
|
||||||
# Add some more warnings which we use in development but not in the
|
# Add some more warnings which we use in development but not in the
|
||||||
# released versions. (Some relevant gcc versions can't handle these.)
|
# released versions. (Some relevant gcc versions can't handle these.)
|
||||||
if test x$enable_gcc_warnings = xyes && test "$GCC" = "yes"; then
|
if test x$enable_gcc_warnings != xno && test "$GCC" = "yes"; then
|
||||||
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
|
||||||
#if !defined(__GNUC__) || (__GNUC__ < 4)
|
#if !defined(__GNUC__) || (__GNUC__ < 4)
|
||||||
@ -650,7 +652,11 @@ if test x$enable_gcc_warnings = xyes && test "$GCC" = "yes"; then
|
|||||||
#error
|
#error
|
||||||
#endif])], have_clang29orlower=yes, have_clang29orlower=no)
|
#endif])], have_clang29orlower=yes, have_clang29orlower=no)
|
||||||
|
|
||||||
CFLAGS="$CFLAGS -W -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wbad-function-cast -Wswitch-enum -Werror"
|
CFLAGS="$CFLAGS -W -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wbad-function-cast -Wswitch-enum"
|
||||||
|
if test x$enable_gcc_warnings = xyes; then
|
||||||
|
CFLAGS="$CFLAGS -Werror"
|
||||||
|
fi
|
||||||
|
|
||||||
CFLAGS="$CFLAGS -Wno-unused-parameter -Wstrict-aliasing"
|
CFLAGS="$CFLAGS -Wno-unused-parameter -Wstrict-aliasing"
|
||||||
|
|
||||||
if test x$have_gcc4 = xyes ; then
|
if test x$have_gcc4 = xyes ; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user