summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac4
-rw-r--r--src/common.hh4
2 files changed, 5 insertions, 3 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"
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 <cassert>