On 19/05/21 16:50 +0100, 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. Resending patch v2 with a modified subject, to see if patchwork picks it up.