-AX_COMPILER_FLAGS(
- [WARN_CFLAGS], dnl CFLAGS variable name
- [WARN_LDFLAGS], dnl LDFLAGS variable name (unused for now)
- [], dnl is-release
- [], dnl Extra base CFLAGS
- [ dnl Extra "yes" CFLAGS
- dnl Disable these flags, either because we don't want them
- dnl or because we want them but are not ready to enable them
- dnl yet.
- -Wno-sign-compare dnl
- -Wno-inline dnl
- -Wno-declaration-after-statement dnl
- -Wno-switch-enum dnl
- -Wno-switch-default dnl
- -Wno-packed dnl
- -Wno-pointer-arith dnl
+
+# Detect warning flags supported by the compiler, append them to WARN_CFLAGS.
+#
+# Pass -Werror as an extra flag during the test: this is needed to make the
+# -Wunknown-warning-option diagnostic fatal with clang.
+AX_APPEND_COMPILE_FLAGS([ dnl
+ -Wall dnl
+ -Wextra dnl
+ -Wstrict-prototypes dnl
+ -Wmissing-prototypes dnl
+ -Wmissing-declarations dnl
+ -Wnull-dereference dnl
+ -Wundef dnl
+ -Wredundant-decls dnl
+ -Wshadow dnl
+ -Wjump-misses-init dnl
+ -Wtautological-constant-out-of-range-compare dnl
+ -Wnested-externs dnl
+ -Wwrite-strings dnl
+ -Wformat=2 dnl