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: Matthias van de Meent <boekewurm+postgres@gmail.com>
Cc: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2025-12-03T15:15:41Z
Lists: pgsql-hackers
Matthias van de Meent <boekewurm+postgres@gmail.com> writes:
> I noticed the only changes here are for `static` definitions. Are we
> just more careful with normal functions, or does the compiler complain
> more easily about such "incomplete" definitions when they're in
> headers or need to be linked against?

Some years ago we had a buildfarm animal that would complain about
this construct, so the tree used to be clean.  Probably it's just
chance that these have only snuck into local functions.

			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 →
  1. Enable -Wstrict-prototypes and -Wold-style-definition by default

  2. Use "foo(void)" for definitions of functions with no parameters.