Add -Wold-style-definition to CFLAGS? - Mailing list pgsql-hackers

From Andres Freund
Subject Add -Wold-style-definition to CFLAGS?
Date
Msg-id 20200509174820.g4bwftmz7blz35ph@alap3.anarazel.de
Whole thread Raw
Responses Re: Add -Wold-style-definition to CFLAGS?
List pgsql-hackers
Hi,

ISTM that it's our coding style that we use

something
my_paramless_func(void)
{
...
}

definitions rather than omitting the (void), which makes the function
look like an old-style function declaration. I somewhat regularly notice
such omissions during review, and fix them.

Since gcc has a warning detecting such definition, I think we ought to
automatically add it when available?

The attached patch makes configure do so, and also fixes a handful of
uses that crept in.

Greetings,

Andres Freund

Attachment

pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Incremental sorts and EXEC_FLAG_REWIND
Next
From: Ranier Vilela
Date:
Subject: Re: [PATCH] Fix division by zero (explain.c)