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

2025-12-03 Thread Tom Lane
Bertrand Drouvot 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 buildfar

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

2025-12-03 Thread Nathan Bossart
Committed. -- nathan

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

2025-12-03 Thread Nathan Bossart
On Wed, Dec 03, 2025 at 03:53:37PM +, Bertrand Drouvot wrote: > 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... > > Those new two (run_app

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

2025-12-03 Thread Bertrand Drouvot
d usage()) are also static, so that's just chance. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com >From 3da01ff159d2e88fad0fd781d514215254614fba Mon Sep 17 00:00:00 2001 From: Bertrand Drouvot Date: Wed, 3 Dec 2025 13:2

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

2025-12-03 Thread Tom Lane
Matthias van de Meent 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

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

2025-12-03 Thread Matthias van de Meent
On Wed, 3 Dec 2025 at 15:51, Bertrand Drouvot wrote: > > Hi hackers, > > In C standards till C17, func() means "unspecified parameters" while > func(void) > means "no parameters". The former disables compile time type checking and was > marked obsolescent in C99 ([1]). > > This patch replaces emp

Use func(void) for functions with no parameters

2025-12-03 Thread Bertrand Drouvot
2001 From: Bertrand Drouvot Date: Wed, 3 Dec 2025 13:25:24 +0000 Subject: [PATCH v1] Use func(void) for functions with no parameters In C standards till C17, func() means "unspecified parameters" while func(void) means "no parameters". The former disables compile time type che