summaryrefslogtreecommitdiff
path: root/config-scripts
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2018-11-06 16:16:16 -0500
committerMichael R Sweet <michael.r.sweet@gmail.com>2018-11-06 16:16:16 -0500
commit6276d173b6bf9774747e33da79fbd2076f657f3b (patch)
tree3ba2abb8065b40caaa9621bd3921f36eba1ed7db /config-scripts
parentbafe8fce844bc0dc5c3af07cbb7610e99203a154 (diff)
downloadcups-6276d173b6bf9774747e33da79fbd2076f657f3b.tar.gz
Fix compiler warnings (Issue #5423)
Diffstat (limited to 'config-scripts')
-rw-r--r--config-scripts/cups-compiler.m440
1 files changed, 11 insertions, 29 deletions
diff --git a/config-scripts/cups-compiler.m4 b/config-scripts/cups-compiler.m4
index a6923750a..0921b25dd 100644
--- a/config-scripts/cups-compiler.m4
+++ b/config-scripts/cups-compiler.m4
@@ -1,7 +1,7 @@
dnl
dnl Compiler stuff for CUPS.
dnl
-dnl Copyright 2007-2017 by Apple Inc.
+dnl Copyright 2007-2018 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.
@@ -152,34 +152,16 @@ if test -n "$GCC"; then
if test "x$with_optim" = x; then
# Add useful warning options for tracking down problems...
- OPTIM="-Wall -Wno-format-y2k -Wunused $OPTIM"
-
- AC_MSG_CHECKING(whether compiler supports -Wno-unused-result)
- OLDCFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -Werror -Wno-unused-result"
- AC_TRY_COMPILE(,,
- [OPTIM="$OPTIM -Wno-unused-result"
- AC_MSG_RESULT(yes)],
- AC_MSG_RESULT(no))
- CFLAGS="$OLDCFLAGS"
-
- AC_MSG_CHECKING(whether compiler supports -Wsign-conversion)
- OLDCFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -Werror -Wsign-conversion"
- AC_TRY_COMPILE(,,
- [OPTIM="$OPTIM -Wsign-conversion"
- AC_MSG_RESULT(yes)],
- AC_MSG_RESULT(no))
- CFLAGS="$OLDCFLAGS"
-
- AC_MSG_CHECKING(whether compiler supports -Wno-tautological-compare)
- OLDCFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -Werror -Wno-tautological-compare"
- AC_TRY_COMPILE(,,
- [OPTIM="$OPTIM -Wno-tautological-compare"
- AC_MSG_RESULT(yes)],
- AC_MSG_RESULT(no))
- CFLAGS="$OLDCFLAGS"
+ OPTIM="-Wall -Wno-format-y2k -Wunused -Wno-unused-result -Wsign-conversion $OPTIM"
+
+ # Test GCC version for certain warning flags since -Werror
+ # doesn't trigger...
+ gccversion=`$CC --version | head -1 | awk '{print $NF}'`
+ case "$gccversion" in
+ 7.*)
+ OPTIM="$OPTIM -Wno-format-truncation -Wno-tautological-compare"
+ ;;
+ esac
# Additional warning options for development testing...
if test -d .git; then