Add -Wold-style-definition to CFLAGS?

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Add -Wold-style-definition to CFLAGS?
Date: 2020-05-09 17:48:20
Message-ID: 20200509174820.g4bwftmz7blz35ph@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
0001-Add-Wold-style-definition-to-CFLAGS.patch text/x-diff 4.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ranier Vilela 2020-05-09 17:51:50 Re: [PATCH] Fix division by zero (explain.c)
Previous Message Tomas Vondra 2020-05-09 17:46:37 Re: Incremental sorts and EXEC_FLAG_REWIND