diff options
| author | Joel Klinghed <the_jk@yahoo.com> | 2017-07-22 01:26:18 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@yahoo.com> | 2017-07-22 01:29:57 +0200 |
| commit | face8e0a7d5f530ee3e5e63ab1e3d6ecd497326b (patch) | |
| tree | 17444e0125da8e57cd34d3b3bc675d4332d76b47 /configure.ac | |
| parent | bb61eeb6aecab1492b62426433af7c3c963a060b (diff) | |
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
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 53d0306..7564309 100644 --- a/configure.ac +++ b/configure.ac @@ -46,7 +46,9 @@ CXXFLAGS="$OLDCXXFLAGS" AX_CXXFLAGS_WARN_ALL([DEFINES]) AX_APPEND_COMPILE_FLAGS([-fno-rtti -fno-exceptions],DEFINES) -AX_APPEND_COMPILE_FLAGS([-Wextra -Wno-missing-field-initializers],DEFINES) +extra_flags= +AX_CHECK_COMPILE_FLAG([-Werror], [extra_flags=-Werror]) +AX_APPEND_COMPILE_FLAGS([-Wextra -Wno-missing-field-initializers -Wno-maybe-uninitialized],DEFINES,[$extra_flags]) AC_ARG_ENABLE([debug], AC_HELP_STRING([compile with debug options]), if test "x$enableval" = "xyes"; then DEFINES="$DEFINES -g -O0 -DDEBUG" |
