From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 1EC853858C2C for ; Thu, 30 Sep 2021 10:43:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1EC853858C2C Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-163-AouRl1a1NyqSIJ5_24uJ3Q-1; Thu, 30 Sep 2021 06:43:27 -0400 X-MC-Unique: AouRl1a1NyqSIJ5_24uJ3Q-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C039E362FB; Thu, 30 Sep 2021 10:43:26 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.176]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A07D652AC; Thu, 30 Sep 2021 10:43:25 +0000 (UTC) From: Florian Weimer To: Jonathan Wakely via Libc-alpha Cc: Joseph Myers , Jonathan Wakely Subject: Re: [PATCH v2] Suppress -Wcast-qual warnings in bsearch References: Date: Thu, 30 Sep 2021 12:43:23 +0200 In-Reply-To: (Jonathan Wakely via Libc-alpha's message of "Thu, 30 Sep 2021 10:22:20 +0100") Message-ID: <87czoq4a44.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 10:43:32 -0000 * Jonathan Wakely via Libc-alpha: > diff --git a/bits/stdlib-bsearch.h b/bits/stdlib-bsearch.h > index 4132dc6af0..d688ed2e15 100644 > --- a/bits/stdlib-bsearch.h > +++ b/bits/stdlib-bsearch.h > @@ -29,14 +29,21 @@ bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size, > while (__l < __u) > { > __idx = (__l + __u) / 2; > - __p = (void *) (((const char *) __base) + (__idx * __size)); > + __p = (const void *) (((const char *) __base) + (__idx * __size)); > __comparison = (*__compar) (__key, __p); > if (__comparison < 0) > __u = __idx; > else if (__comparison > 0) > __l = __idx + 1; > else > +#if __GNUC_PREREQ(4, 6) > +# pragma GCC diagnostic push > +# pragma GCC diagnostic ignored "-Wcast-qual" > +#endif > return (void *) __p; > +#if __GNUC_PREREQ(4, 6) > +# pragma GCC diagnostic pop > +#endif > } > > return NULL; Patch looks okay, thanks. Reviewed-by: Florian Weimer Florian