Bertrand Drouvot <[email protected]> writes:
> On Wed, Dec 03, 2025 at 11:32:10PM -0500, Tom Lane wrote:
>> I looked into enabling -Wstrict-prototypes on one of my buildfarm
>> animals, but the attempt failed because libreadline's headers are
>> not clean.
> It took me some time to reproduce the errors...
> The reason is that gcc/clang treat certain directories (like /usr/include and
> /usr/local/include on my system) as "system headers" and suppress warnings
> from
> them, even with -Wsystem-headers.
Oh, duh. You guessed correctly: I was trying this on BF animal
indri, which gets a lot of stuff from MacPorts and therefore these
headers are under /opt/local/include. I wonder whether I should
adjust its build flags to treat that as a system directory.
It hasn't been a problem up to now, but ...
> Yeah, what about using Pragma Directives instead, like in the
> attached?
Yeah, a pragma is probably safer than what I was thinking about.
But I'd be inclined to just use "#pragma GCC system_header" in
input.h, since that's already tested and used elsewhere in the tree.
There's little enough other stuff in that file that I think we
could just do it, and not bother breaking out a sub-include file
like we did in plperl and plpython.
In any case, I don't think we should bother unless there's a push to
enable -Wstrict-prototypes by default, which I've not heard being
proposed.
regards, tom lane