Re: Use func(void) for functions with no parameters
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: Matthias van de Meent <boekewurm+postgres@gmail.com>,
pgsql-hackers@lists.postgresql.org
Date: 2025-12-04T15:17:28Z
Lists: 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
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Enable -Wstrict-prototypes and -Wold-style-definition by default
- 29bf4ee7496c 19 (unreleased) landed
-
Use "foo(void)" for definitions of functions with no parameters.
- 9b05e2ec08a3 19 (unreleased) landed