pgsql: "A void function may not return a value".

Started by Tom Laneabout 7 years ago3 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

"A void function may not return a value".

Per buildfarm.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d307954a7d88ed45655d9206bbe1aefc280c09c7

Modified Files
--------------
src/backend/access/table/tableam.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

#2Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#1)
Re: pgsql: "A void function may not return a value".

Hi,

On 2019-05-18 04:40:51 +0000, Tom Lane wrote:

"A void function may not return a value".

Darn. Thanks.

For C only, warn about a "return" statement with an expression in a function whose return type is "void", unless the expression type is also
"void". As a GNU extension, the latter case is accepted without a warning unless -Wpedantic is used.

And no, no thanks to you gcc. -pedantic is entirely unusable. It warns
about extensions we explicitly test for :(

- Andres

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#2)
Re: pgsql: "A void function may not return a value".

Andres Freund <andres@anarazel.de> writes:

On 2019-05-18 04:40:51 +0000, Tom Lane wrote:

"A void function may not return a value".

Darn. Thanks.

For C only, warn about a "return" statement with an expression in a function whose return type is "void", unless the expression type is also
"void". As a GNU extension, the latter case is accepted without a warning unless -Wpedantic is used.

The scary thing is that apparently almost everybody else has followed
gcc's lead on this.

regards, tom lane