Re: Use func(void) for functions with no parameters

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Use func(void) for functions with no parameters
Дата
Msg-id 1049756.1764861448@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Use func(void) for functions with no parameters  (Bertrand Drouvot <bertranddrouvot.pg@gmail.com>)
Ответы Re: Use func(void) for functions with no parameters
Список pgsql-hackers
Bertrand Drouvot <bertranddrouvot.pg@gmail.com> 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



В списке pgsql-hackers по дате отправления: