pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: pgsql-committers <pgsql-committers@lists.postgresql.org>
Subject: Re: pgsql: Remove dependency on HeapTuple from predicate locking functions.
Date: Tue, 28 Jan 2020 10:05:36 -0500
Message-ID: <7230.1580223936@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+hUKG++GRiv1ELbt8DW4Tw117SiV1EXE_Yc2j8d6JW8xmTDzw@mail.gmail.com>
References: <E1iwF1n-0000bS-3A@gemulon.postgresql.org>
	<16942.1580191174@sss.pgh.pa.us>
	<CA+hUKG++GRiv1ELbt8DW4Tw117SiV1EXE_Yc2j8d6JW8xmTDzw@mail.gmail.com>

Thomas Munro <thomas.munro@gmail.com> writes:
> On Tue, Jan 28, 2020 at 6:59 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> anole's not terribly pleased with this:
>> "heapam.c", line 9137: error #2118: a void function may not return a value
>> return CheckForSerializableConflictOut(relation, xid, snapshot);

> Thanks.  I pushed a fix.
> Wow, HP C spits out a lot of warnings.

It's pretty noisy, and most of 'em are useless :-(.  But as for this
particular complaint, I don't really understand why gcc lets it slide.
The C99 standard is not exactly ambiguous about this:

       6.8.6.4  The return statement

       Constraints

       [#1]  A return statement with an expression shall not appear
       in a function whose return type is void.  A return statement
       without  an expression shall only appear in a function whose
       return type is void.

There is absolutely no question that the original coding is illegal
per spec, and it isn't even a particularly useful shorthand; so why
can't we get even a warning about it?

			regards, tom lane





view thread (6+ messages)  latest in thread

Message-ID: <7230.1580223936@sss.pgh.pa.us>
Permalink:  ../7230.1580223936@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7230.1580223936@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, thomas.munro@gmail.com
  Subject: Re: pgsql: Remove dependency on HeapTuple from predicate locking functions.
  In-Reply-To: <7230.1580223936@sss.pgh.pa.us>
  References: <E1iwF1n-0000bS-3A@gemulon.postgresql.org> <16942.1580191174@sss.pgh.pa.us> <CA+hUKG++GRiv1ELbt8DW4Tw117SiV1EXE_Yc2j8d6JW8xmTDzw@mail.gmail.com> <7230.1580223936@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox