From: Michael R Sweet Date: Mon, 3 Sep 2018 13:30:08 +0000 (-0400) Subject: Silence some bogus Clang warnings. X-Git-Tag: v2.3b6~102 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fcups.git;a=commitdiff_plain;h=29bda83e12534f17c95dfd575b56a06fb747c8e7 Silence some bogus Clang warnings. --- diff --git a/cups/ipp.c b/cups/ipp.c index f30d8428f..afd85474d 100644 --- a/cups/ipp.c +++ b/cups/ipp.c @@ -6779,7 +6779,9 @@ ipp_set_value(ipp_t *ipp, /* IO - IPP message */ * Reset pointers in the list... */ +#ifndef __clang_analyzer__ DEBUG_printf(("4debug_free: %p %s", (void *)*attr, temp->name)); +#endif /* !__clang_analyzer__ */ DEBUG_printf(("4debug_alloc: %p %s %s%s (%d)", (void *)temp, temp->name, temp->num_values > 1 ? "1setOf " : "", ippTagString(temp->value_tag), temp->num_values)); if (ipp->current == *attr && ipp->prev) diff --git a/cups/snmp.c b/cups/snmp.c index cd88b2098..1e1fa3eef 100644 --- a/cups/snmp.c +++ b/cups/snmp.c @@ -1234,10 +1234,10 @@ asn1_get_integer( return (0); } - for (value = (**buffer & 0x80) ? -1 : 0; + for (value = (**buffer & 0x80) ? ~0 : 0; length > 0 && *buffer < bufend; length --, (*buffer) ++) - value = (value << 8) | **buffer; + value = ((value & 0xffffff) << 8) | **buffer; return (value); } diff --git a/test/ipptool.c b/test/ipptool.c index 39ccb286b..9b5bc6395 100644 --- a/test/ipptool.c +++ b/test/ipptool.c @@ -4783,7 +4783,7 @@ with_value(_cups_testdata_t *data, /* I - Test data */ * Grab hex-encoded value... */ - if ((withlen = (int)strlen(value)) & 1 || withlen > (2 * (sizeof(withdata) + 1))) + if ((withlen = (int)strlen(value)) & 1 || withlen > (int)(2 * (sizeof(withdata) + 1))) { print_fatal_error(data, "Bad WITH-VALUE hex value."); return (0);