From: Michael R Sweet Date: Tue, 6 Nov 2018 21:28:08 +0000 (-0500) Subject: Mirror changes from master. X-Git-Tag: v2.2.9~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd93b0f997fb3ab5e442a45fe64b28c602f76b7d;p=thirdparty%2Fcups.git Mirror changes from master. --- diff --git a/config-scripts/cups-compiler.m4 b/config-scripts/cups-compiler.m4 index 49963934f5..7bde5662c9 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 These coded instructions, statements, and computer programs are the @@ -156,46 +156,19 @@ 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" - - 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" + 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 .svn; then + if test -d .git; then OPTIM="-Werror $OPTIM" fi fi diff --git a/configure b/configure index e45954100b..d3fdae04f6 100755 --- a/configure +++ b/configure @@ -7035,114 +7035,19 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$with_optim" = x; then # Add useful warning options for tracking down problems... - OPTIM="-Wall -Wno-format-y2k -Wunused $OPTIM" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -Wno-unused-result" >&5 -$as_echo_n "checking whether compiler supports -Wno-unused-result... " >&6; } - OLDCFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror -Wno-unused-result" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - OPTIM="$OPTIM -Wno-unused-result" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$OLDCFLAGS" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -Wsign-conversion" >&5 -$as_echo_n "checking whether compiler supports -Wsign-conversion... " >&6; } - OLDCFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror -Wsign-conversion" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - OPTIM="$OPTIM -Wsign-conversion" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$OLDCFLAGS" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -Wno-tautological-compare" >&5 -$as_echo_n "checking whether compiler supports -Wno-tautological-compare... " >&6; } - OLDCFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror -Wno-tautological-compare" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - OPTIM="$OPTIM -Wno-tautological-compare" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$OLDCFLAGS" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -Wno-format-truncation" >&5 -$as_echo_n "checking whether compiler supports -Wno-format-truncation... " >&6; } - OLDCFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror -Wno-format-truncation" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - OPTIM="$OPTIM -Wno-format-truncation" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - 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 .svn; then + if test -d .git; then OPTIM="-Werror $OPTIM" fi fi diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c index 6f8e6dc608..9ed946e687 100644 --- a/cups/ppd-cache.c +++ b/cups/ppd-cache.c @@ -3130,22 +3130,22 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */ /* Type of password */ if (maxlen > (int)(sizeof(pattern) - 1)) - maxlen = sizeof(pattern) - 1; + maxlen = (int)sizeof(pattern) - 1; if (!repertoire || !strcmp(repertoire, "iana_us-ascii_digits")) - memset(pattern, '1', maxlen); + memset(pattern, '1', (size_t)maxlen); else if (!strcmp(repertoire, "iana_us-ascii_letters")) - memset(pattern, 'A', maxlen); + memset(pattern, 'A', (size_t)maxlen); else if (!strcmp(repertoire, "iana_us-ascii_complex")) - memset(pattern, 'C', maxlen); + memset(pattern, 'C', (size_t)maxlen); else if (!strcmp(repertoire, "iana_us-ascii_any")) - memset(pattern, '.', maxlen); + memset(pattern, '.', (size_t)maxlen); else if (!strcmp(repertoire, "iana_utf-8_digits")) - memset(pattern, 'N', maxlen); + memset(pattern, 'N', (size_t)maxlen); else if (!strcmp(repertoire, "iana_utf-8_letters")) - memset(pattern, 'U', maxlen); + memset(pattern, 'U', (size_t)maxlen); else - memset(pattern, '*', maxlen); + memset(pattern, '*', (size_t)maxlen); pattern[maxlen] = '\0'; @@ -3866,7 +3866,7 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */ if (tray_len >= (int)sizeof(tray)) tray_len = (int)sizeof(tray) - 1; - memcpy(tray, tray_ptr, tray_len); + memcpy(tray, tray_ptr, (size_t)tray_len); tray[tray_len] = '\0'; if (strstr(tray, "stackingorder=lastToFirst;")) diff --git a/cups/tls-gnutls.c b/cups/tls-gnutls.c index 68bacc6923..606b45afce 100644 --- a/cups/tls-gnutls.c +++ b/cups/tls-gnutls.c @@ -399,7 +399,7 @@ httpCredentialsAreValidForName( for (i = 0; i < count; i ++) { rserial_size = sizeof(rserial); - if (!gnutls_x509_crl_get_crt_serial(tls_crl, (unsigned)i, rserial, &rserial_size, NULL) && cserial_size == rserial_size && !memcmp(cserial, rserial, (int)rserial_size)) + if (!gnutls_x509_crl_get_crt_serial(tls_crl, (unsigned)i, rserial, &rserial_size, NULL) && cserial_size == rserial_size && !memcmp(cserial, rserial, rserial_size)) { result = 0; break; diff --git a/scheduler/ipp.c b/scheduler/ipp.c index 90d4a14ca1..74566b68a8 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -5873,7 +5873,7 @@ create_subscriptions( { char temp[64]; /* Temporary string */ - memcpy(temp, user_data->values[0].unknown.data, user_data->values[0].unknown.length); + memcpy(temp, user_data->values[0].unknown.data, (size_t)user_data->values[0].unknown.length); temp[user_data->values[0].unknown.length] = '\0'; if (httpSeparateURI(HTTP_URI_CODING_ALL, temp, scheme, sizeof(scheme), userpass, sizeof(userpass), host, sizeof(host), &port, resource, sizeof(resource)) < HTTP_URI_OK)