summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2006-06-29 10:18:22 +0000
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2006-06-29 10:18:22 +0000
commit3b1845a2acc6b7128f96a2ea89fee04572af10e8 (patch)
tree983182e0e10f06dc7292dfdb17629d01b2e3ce8f
parentd57b425cb406647f2d41d32a21a58f80981f3aca (diff)
downloadxine-lib-3b1845a2acc6b7128f96a2ea89fee04572af10e8.tar.gz
xine-lib-3b1845a2acc6b7128f96a2ea89fee04572af10e8.tar.bz2
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
-rw-r--r--configure.ac9
1 files changed, 9 insertions, 0 deletions
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