]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - config-scripts/cups-compiler.m4
Suppress new GCC warning about snprintf truncation (Issue #5110)
[thirdparty/cups.git] / config-scripts / cups-compiler.m4
index bf4411e490af40e262c1cf3e265ea1ec25a2cbea..49963934f5ec6ecc1427d83a34faa9b64036c458 100644 (file)
@@ -185,6 +185,15 @@ if test -n "$GCC"; then
                        AC_MSG_RESULT(no))
                CFLAGS="$OLDCFLAGS"
 
+               AC_MSG_CHECKING(whether compiler supports -Wno-format-truncation)
+               OLDCFLAGS="$CFLAGS"
+               CFLAGS="$CFLAGS -Werror -Wno-format-truncation"
+               AC_TRY_COMPILE(,,
+                       [OPTIM="$OPTIM -Wno-format-truncation"
+                       AC_MSG_RESULT(yes)],
+                       AC_MSG_RESULT(no))
+               CFLAGS="$OLDCFLAGS"
+
                # Additional warning options for development testing...
                if test -d .svn; then
                        OPTIM="-Werror $OPTIM"