From face8e0a7d5f530ee3e5e63ab1e3d6ecd497326b Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Sat, 22 Jul 2017 01:26:18 +0200 Subject: Fix warnings for GCC as well GCC ignores __attribute__((unused)) when compiling C++ code. (Yes, this is true) GCC -Wmaybe-uninitialized just gives false positives in my experience, so drop it. However, this exposed a problem with AX_APPEND_COMPILE_FLAGS and clang. clang gives a warning, but not an error, when given a -Wno-UNKNOWN-FLAG. So add -Werror as an extra flag to make clang fail on unknown -Wno-UNKNOWN-FLAG --- src/common.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/common.hh b/src/common.hh index 67c8fa5..95abcaa 100644 --- a/src/common.hh +++ b/src/common.hh @@ -7,10 +7,10 @@ # include "config.h" #endif -#if HAVE_VAR_ATTRIBUTE_UNUSED +#if HAVE_VAR_ATTRIBUTE_UNUSED && !defined(__GNUG__) # define UNUSED(x) __attribute__((unused)) x ## _unused #else -# define UNUSED(x) x ## _unused +# define UNUSED(x) /* x ## _unused */ #endif #include -- cgit v1.2.3-70-g09d2