[PATCH v2] Suppress -Wcast-qual warnings in bsearch
Jonathan Wakely
jwakely@redhat.com
Thu Sep 30 09:22:20 GMT 2021
Ping for patch originally sent in
https://sourceware.org/pipermail/libc-alpha/2021-May/126572.html
The patch still applies cleanly to current master.
On Wed, 19 May 2021 at 16:50, Jonathan Wakely wrote:
>
> On 19/05/21 15:37 +0000, Joseph Myers wrote:
> >On Wed, 19 May 2021, Jonathan Wakely via Libc-alpha wrote:
> >
> >> +#pragma GCC diagnostic push
> >> +#pragma GCC diagnostic ignored "-Wcast-qual"
> >> return (void *) __p;
> >> +#pragma GCC diagnostic pop
> >
> >I think such pragma uses in installed headers should be conditional on
> >__GNUC_PREREQ (4, 6) (either directly or via conditionally defining a
> >macro in sys/cdefs.h).
>
> Good point.
>
> I spent about two minutes trying to do something with _Pragma in
> sys/cdefs.h to allow:
>
> __GLIBC_IGNORE_WARNING("-Wcast-qual")
> return (void *) __p;
> __GLIBC_UNIGNORE_WARNING
>
> but didn't get it working, so here's a patch that just tests
> __GNUC_PREREQ directly.
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bsearch.patch
Type: application/x-patch
Size: 1316 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20210930/4c708468/attachment.bin>
More information about the Libc-alpha
mailing list