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
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
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
/* 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';
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;"))
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;
{
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)