Re: Use func(void) for functions with no parameters - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Use func(void) for functions with no parameters
Date
Msg-id 980252.1764822730@sss.pgh.pa.us
Whole thread Raw
In response to Re: Use func(void) for functions with no parameters  (Bertrand Drouvot <bertranddrouvot.pg@gmail.com>)
Responses Re: Use func(void) for functions with no parameters
List pgsql-hackers
Bertrand Drouvot <bertranddrouvot.pg@gmail.com> writes:
> On Wed, Dec 03, 2025 at 10:15:41AM -0500, Tom Lane wrote:
>> 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.

> The buildfarm animal remark makes me think to check with -Wstrict-prototypes
> and -Wold-style-definition. I just did that and found two more (added in v2
> attached) that the coccinelle script missed...

I looked into enabling -Wstrict-prototypes on one of my buildfarm
animals, but the attempt failed because libreadline's headers are
not clean.

It looks like we could silence those warnings by #define'ing
HAVE_STDARG_H and _FUNCTION_DEF before including the readline
headers.  A quick test says that then the warnings do not appear,
and psql's regression tests still pass.  But it would require
a good deal more investigation of possible side-effects before
I'd recommend actually doing that.

            regards, tom lane



pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part
Next
From: shveta malik
Date:
Subject: Re: Skipping schema changes in publication