]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror changes from master.
authorMichael R Sweet <michael.r.sweet@gmail.com>
Tue, 6 Nov 2018 21:28:08 +0000 (16:28 -0500)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Tue, 6 Nov 2018 21:28:08 +0000 (16:28 -0500)
config-scripts/cups-compiler.m4
configure
cups/ppd-cache.c
cups/tls-gnutls.c
scheduler/ipp.c

index 49963934f5ec6ecc1427d83a34faa9b64036c458..7bde5662c9837400c735876df61cd4512a776d4f 100644 (file)
@@ -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
index e45954100b08832592fe8e5c026416a5f225247c..d3fdae04f629a3976bbc27175e8960e1c6e1f09e 100755 (executable)
--- 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
index 6f8e6dc60818a6b8a45bf5f951540860b4dbf6b6..9ed946e68739bc3431d729e50d04731a2e12c6ef 100644 (file)
@@ -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;"))
index 68bacc6923812ab405fa5f8edb49a18946aa1829..606b45afce3f7418ac7f7d39b2194ff0ad8a191d 100644 (file)
@@ -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;
index 90d4a14ca1e2b67930664b9776dab2e57b8d9f16..74566b68a8a6db62bd71a6652fdf4ec6e495f352 100644 (file)
@@ -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)