summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-11-01 16:21:02 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-11-01 16:21:02 (EDT)
commitf4ce27f29012cbaa3eafb8586fb27a6098acd873 (patch)
tree1662b5a1c084bf6d42b1d99befcaf0a27778d0f1 /configure.ac
parent27fae33ed4053b2a66f35a20c0b932097ccf0aed (diff)
downloadmarquee-f4ce27f29012cbaa3eafb8586fb27a6098acd873.zip
marquee-f4ce27f29012cbaa3eafb8586fb27a6098acd873.tar.gz
marquee-f4ce27f29012cbaa3eafb8586fb27a6098acd873.tar.bz2
configure.ac: Enable many more warnings
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac30
1 files changed, 21 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index b15f168..6a65990 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,19 +37,31 @@ AX_CHECK_COMPILE_FLAG([-std=c11], [CFLAGS="${CFLAGS} -std=c11"], [
AX_CHECK_COMPILE_FLAG([-std=c1x], [CFLAGS="${CFLAGS} -std=c1x"], [], [])
], [])
-# Consider also:
-# * -Wchkp
-# * -Wformat=2
-# * -Wnull-dereference
-# * -Winit-self
-# * -Wmissing-include-dirs
-# * etc.
-# Cf. <https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html> and
-# <http://git.pehjota.net/overworld-rpg/overworld-rpg.git/tree/configure.ac#n60>
AX_CFLAGS_WARN_ALL() dnl Adds -Wall or equivalent
AX_CHECK_COMPILE_FLAG([-Wpedantic], [AX_APPEND_FLAG([-Wpedantic])])
AX_CHECK_COMPILE_FLAG([-Wextra], [AX_APPEND_FLAG([-Wextra])])
+AC_ARG_ENABLE([gcc-warnings],
+ [AS_HELP_STRING([--enable-gcc-warnings], [turn on many GCC warnings])],
+ [case "${enableval}" in yes|no);; *) AC_MSG_ERROR(
+ [bad value ${enableval} for gcc-warnings option]);; esac],
+ [
+ gcc_warnings=no
+ gl_GCC_VERSION_IFELSE([4], [6],
+ [test -d "${srcdir}/.git" && gcc_warnings=yes])
+ ]
+)
+if test "x${gcc_warnings}" = 'xyes'; then
+ nowarns=''
+ nowarns="${nowarns} -Wsystem-headers"
+ gl_MANYWARN_ALL_GCC([warns])
+ gl_MANYWARN_COMPLEMENT([warns], [${warns}], [${nowarns}])
+ for warn in ${warns}; do
+ gl_WARN_ADD([${warn}])
+ done
+ AC_SUBST([WARN_CFLAGS])
+fi
+
AX_CHECK_COMPILE_FLAG([-fdiagnostics-color=auto],
[AX_APPEND_FLAG([-fdiagnostics-color=auto])])