Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iwSR1-0007O4-Dj for pgsql-committers@arkaria.postgresql.org; Tue, 28 Jan 2020 15:05:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iwSQz-00074M-Pc for pgsql-committers@arkaria.postgresql.org; Tue, 28 Jan 2020 15:05:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iwSQz-00074F-IS for pgsql-committers@lists.postgresql.org; Tue, 28 Jan 2020 15:05:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iwSQt-00049D-6v for pgsql-committers@lists.postgresql.org; Tue, 28 Jan 2020 15:05:45 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 00SF5aBb007231; Tue, 28 Jan 2020 10:05:36 -0500 From: Tom Lane To: Thomas Munro cc: pgsql-committers Subject: Re: pgsql: Remove dependency on HeapTuple from predicate locking functions. In-reply-to: References: <16942.1580191174@sss.pgh.pa.us> Comments: In-reply-to Thomas Munro message dated "Tue, 28 Jan 2020 20:41:10 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7229.1580223936.1@sss.pgh.pa.us> Date: Tue, 28 Jan 2020 10:05:36 -0500 Message-ID: <7230.1580223936@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thomas Munro writes: > On Tue, Jan 28, 2020 at 6:59 PM Tom Lane 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