From 3b1845a2acc6b7128f96a2ea89fee04572af10e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Thu, 29 Jun 2006 10:18:22 +0000 Subject: When available, enable -Wformat warnings class. This prevents adding more possible format string vulnerabilities. CVS patchset: 8075 CVS date: 2006/06/29 10:18:22 --- configure.ac | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configure.ac b/configure.ac index a7193933f..52caba968 100644 --- a/configure.ac +++ b/configure.ac @@ -2295,6 +2295,15 @@ _AM_DEPENDENCIES([OBJC]) AM_CONDITIONAL([BUILD_DMX_IMAGE], [test x"$have_imagemagick" = "xyes" -o x"$no_gdkpixbuf" != "xyes"]) +dnl Important warnings we _don't_ want to skip +dnl Don't put these under conditional for optimisations, because these +dnl need always to be enabled. +AC_TRY_CFLAGS("-Wformat", wformat="-Wformat") +AC_TRY_CFLAGS("-Wformat=2", wformat="-Wformat=2") +if test "x$wformat" != "x"; then + AC_TRY_CFLAGS("-Wno-format-zero-length", wformat="$wformat -Wno-format-zero-length") +fi +CFLAGS="$CFLAGS $wformat" dnl --------------------------------------------- dnl Output configuration files -- cgit v1.2.3