Re: perl 5.36, C99, -Wdeclaration-after-statement -Wshadow=compatible-local - Mailing list pgsql-hackers

From Tom Lane
Subject Re: perl 5.36, C99, -Wdeclaration-after-statement -Wshadow=compatible-local
Date
Msg-id 586729.1672339897@sss.pgh.pa.us
Whole thread Raw
In response to Re: perl 5.36, C99, -Wdeclaration-after-statement -Wshadow=compatible-local  (Andres Freund <andres@anarazel.de>)
Responses Re: perl 5.36, C99, -Wdeclaration-after-statement -Wshadow=compatible-local
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> It turns out to not work terribly well. gcc, quite reasonably, warns about the
> pragma used in .c files, and there's no easy way that I found to have autoconf
> name its test .h. We could include a test header in the compile test, but that
> also adds some complication. As gcc has supported the pragma since 2000, I
> think a simple
>   #ifdef __GNUC__
>   #define HAVE_PRAGMA_SYSTEM_HEADER    1
>   #endif
> should suffice.

We might find that some GCC-impostor compilers have trouble with it,
but if so we can adjust the #ifdef here.

Getting nitpicky, I suggest calling it "HAVE_PRAGMA_GCC_SYSTEM_HEADER"
to align better with what you actually have to write.  Also:

+ * Newer versions the perl headers trigger a lot of warnings with our compiler

"Newer versions of ..." please.  Otherwise LGTM.

> Should we backpatch this? Given the volume of warnings it's probably a good
> idea. But I'd let it step in HEAD for a few days of buildfarm coverage first.

+1 to both points.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #17717: Regression in vacuumdb (15 is slower than 10/11 and possible memory issue)
Next
From: Nathan Bossart
Date:
Subject: Re: BUG #17717: Regression in vacuumdb (15 is slower than 10/11 and possible memory issue)