From: Diego E. 'F. P. <fla...@gm...> - 2008-11-19 02:00:31
|
# HG changeset patch # User Diego E. 'Flameeyes' Pettenò <fla...@gm...> # Date 1227059979 -3600 # Node ID a023984fcfb64af77e8c4cf07e88b7fbdf29d792 # Parent 63452fdc281bdd06cf3a964866de9958b9069d7d Enable basic warnings even when optimisations are disabled. We don't want to have warnings conditional to extreme optimisations: if the compiler supports them, they should be enabled. The reason why they were conditional is that the code testing for GCC presence enabled both warnings and optimisations, and the warnings were carried over when the optimisations were made optional. diff -r a023984fcfb64af77e8c4cf07e88b7fbdf29d792 -r 63452fdc281bdd06cf3a964866de9958b9069d7d configure.ac --- a/configure.ac Wed Nov 19 02:59:39 2008 +0100 +++ b/configure.ac Wed Nov 19 02:47:24 2008 +0100 @@ -2617,22 +2617,27 @@ _AM_DEPENDENCIES([OBJC]) AM_CONDITIONAL([BUILD_DMX_IMAGE], [test "x$have_imagemagick" = "xyes" -o "x$no_gdkpixbuf" != "xyes"]) -dnl Important warnings we _don't_ want to skip -dnl Don't put these under conditional for optimisations, because these -dnl need always to be enabled. +dnl We check for warnings here rather than with optimisations since we +dnl want them to be _always_ enabled, to make sure the code is sane +dnl enough. + +CC_CHECK_CFLAGS_APPEND([-Wall -Wchar-subscripts dnl + -Wnested-externs -Wcast-align dnl + -Wmissing-declarations -Wmissing-prototypes dnl + -Wmissing-format-attribute]) + CC_CHECK_CFLAGS_APPEND([-Wformat=2 -Wformat], [CC_CHECK_CFLAGS_APPEND([-Wno-format-zero-length]) break; ]) -CC_CHECK_CFLAGS_APPEND([-Wmissing-format-attribute]) - dnl check for strict aliasing problem, get the highest between =2 and dnl normal. CC_CHECK_CFLAGS_APPEND([-Wstrict-aliasing=2 -Wstrict-aliasing], [break;]) dnl This *has* to stay at the end as it can break some autoconf tests. -CC_CHECK_CFLAGS_APPEND([-Werror=implicit-function-declaration -Werror-implicit-function-declaration], [break;]) +CC_CHECK_CFLAGS_APPEND([-Werror=implicit-function-declaration dnl + -Werror-implicit-function-declaration], [break;]) CC_NOUNDEFINED diff -r a023984fcfb64af77e8c4cf07e88b7fbdf29d792 -r 63452fdc281bdd06cf3a964866de9958b9069d7d m4/optimizations.m4 --- a/m4/optimizations.m4 Wed Nov 19 02:59:39 2008 +0100 +++ b/m4/optimizations.m4 Wed Nov 19 02:47:24 2008 +0100 @@ -43,11 +43,6 @@ AC_DEFUN([AC_OPTIMIZATIONS], [ CC_CHECK_CFLAGS([-fbranch-probabilities], PASS2_CFLAGS="-fbranch-probabilities $PASS2_CFLAGS",) AC_SUBST(PASS1_CFLAGS) AC_SUBST(PASS2_CFLAGS) - dnl - dnl Warnings - dnl - CFLAGS="-Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes $CFLAGS" - CFLAGS="-Wnested-externs -Wcast-align $CFLAGS" dnl some combinations of gcc+glibc produce useless warnings on memset dnl when compiling with -Wpointer-arith, so we check for this first AC_MSG_CHECKING(for sane -Wpointer-arith) @@ -67,9 +62,6 @@ AC_DEFUN([AC_OPTIMIZATIONS], [ AC_MSG_RESULT(${newGCC:-no - assuming bugginess in -finline-functions}) test "$newGCC" = yes || INLINE_FUNCTIONS=-fno-inline-functions fi - - dnl Flags not supported by all *cc* variants - CC_CHECK_CFLAGS([-Wall], wall="-Wall", wall="") CFLAGS="$wall ${CFLAGS}" DEBUG_CFLAGS="$wall ${DEBUG_CFLAGS}" |