]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - config-scripts/cups-compiler.m4
CUPS v2.3.6 for CVE-2022-26691
[thirdparty/cups.git] / config-scripts / cups-compiler.m4
index 7cd440ff487d518d0ff7a6a08a68f829cc89a9a1..604faf1b9f0484a9c7602ad0110f412101e65e2b 100644 (file)
@@ -1,7 +1,7 @@
 dnl
 dnl Compiler stuff for CUPS.
 dnl
-dnl Copyright 2007-2018 by Apple Inc.
+dnl Copyright 2007-2020 by Apple Inc.
 dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
 dnl
 dnl Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
@@ -102,15 +102,15 @@ if test -n "$GCC"; then
 
         # Address sanitizer is a useful tool to use when developing/debugging
         # code but adds about 2x overhead...
-        if test x$enable_sanitizer = xyes; then
-               # Use -fsanitize=address with debugging...
+       if test x$enable_sanitizer = xyes; then
+               # Use -fsanitize=address with debugging...
                OPTIM="$OPTIM -g -fsanitize=address"
-        else
-               # Otherwise use the Fortify enhancements to catch any unbounded
-               # string operations...
-               CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
-               CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=2"
-        fi
+       else
+               # Otherwise use the Fortify enhancements to catch any unbounded
+               # string operations...
+               CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
+               CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=2"
+       fi
 
        # Default optimization options...
        if test -z "$OPTIM"; then
@@ -169,20 +169,20 @@ if test -n "$GCC"; then
        fi
 
        # Add useful warning options for tracking down problems...
-       WARNING_OPTIONS="-Wall -Wno-format-y2k -Wunused -Wno-unused-result -Wsign-conversion"
+       WARNING_OPTIONS="-Wall -Wno-format-y2k -Wunused -Wno-unused-result -Wsign-conversion  -Wno-unused-but-set-variable  -Wno-unused-variable"
 
        # Test GCC version for certain warning flags since -Werror
        # doesn't trigger...
        gccversion=`$CC --version | head -1 | awk '{print $NF}'`
        case "$gccversion" in
-               7.* | 8.*)
+        7.* | 8.* | 9.*)
                        WARNING_OPTIONS="$WARNING_OPTIONS -Wno-format-truncation -Wno-tautological-compare"
                        ;;
        esac
 
        # Additional warning options for development testing...
        if test -d .git; then
-               WARNING_OPTIONS="-Werror $WARNING_OPTIONS"
+               WARNING_OPTIONS="-Werror -Wno-error=deprecated-declarations -Wno-unknown-warning-option $WARNING_OPTIONS"
        fi
 else
        # Add vendor-specific compiler options...