From da654e7ea7880785955798fedaf12340d99356b1 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sat, 26 Oct 2013 12:12:24 +0200 Subject: [PATCH] build system: add -Wlogical-op warning flag for gcc 4.8.x --- Rakefile | 2 +- ac/compiler_flags.m4 | 3 +++ build-config.in | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index f30b1f3ca..8d50ce494 100755 --- a/Rakefile +++ b/Rakefile @@ -89,7 +89,7 @@ def setup_globals $build_tools ||= c?(:TOOLS) - cflags_common = "-Wall -Wno-comment -Wfatal-errors #{c(:WNO_MISMATCHED_TAGS)} #{c(:WNO_SELF_ASSIGN)} #{c(:QUNUSED_ARGUMENTS)}" + cflags_common = "-Wall -Wno-comment -Wfatal-errors #{c(:WLOGICAL_OP)} #{c(:WNO_MISMATCHED_TAGS)} #{c(:WNO_SELF_ASSIGN)} #{c(:QUNUSED_ARGUMENTS)}" cflags_common += "#{c(:OPTIMIZATION_CFLAGS)} -D_FILE_OFFSET_BITS=64 #{c(:MATROSKA_CFLAGS)} #{c(:EBML_CFLAGS)} #{c(:EXTRA_CFLAGS)} #{c(:DEBUG_CFLAGS)} #{c(:PROFILING_CFLAGS)} #{c(:USER_CPPFLAGS)} " cflags_common += "-DPACKAGE=\\\"#{c(:PACKAGE)}\\\" -DVERSION=\\\"#{c(:VERSION)}\\\" -DMTX_LOCALE_DIR=\\\"#{c(:localedir)}\\\" -DMTX_PKG_DATA_DIR=\\\"#{c(:pkgdatadir)}\\\" -DMTX_DOC_DIR=\\\"#{c(:docdir)}\\\" " cflags_common += "-mno-ms-bitfields -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 " if c?(:MINGW) diff --git a/ac/compiler_flags.m4 b/ac/compiler_flags.m4 index 3b1232653..b8a233b0e 100644 --- a/ac/compiler_flags.m4 +++ b/ac/compiler_flags.m4 @@ -7,6 +7,9 @@ if test x"$ac_cv_compiler_is_clang" = xyes; then QUNUSED_ARGUMENTS="-Qunused-arguments" WNO_SELF_ASSIGN="-Wno-self-assign" WNO_MISMATCHED_TAGS="-Wno-mismatched-tags" + +elif check_version 4.8.0 $ac_cv_gcc_version ; then + WLOGICAL_OP="-Wlogical-op" fi AC_SUBST(QUNUSED_ARGUMENTS) diff --git a/build-config.in b/build-config.in index 73122d052..a51691761 100644 --- a/build-config.in +++ b/build-config.in @@ -111,6 +111,7 @@ USER_CXXFLAGS = @USER_CXXFLAGS@ USER_CFLAGS = @USER_CFLAGS@ USER_LDFLAGS = @USER_LDFLAGS@ VORBIS_LIBS = @VORBIS_LIBS@ +WLOGICAL_OP = @WLOGICAL_OP@ WNO_MISMATCHED_TAGS = @WNO_MISMATCHED_TAGS@ WNO_SELF_ASSIGN = @WNO_SELF_ASSIGN@ WXWIDGETS_CFLAGS = @WXWIDGETS_CFLAGS@