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.
# 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
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...