Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnW6v-0000zX-GU for pgsql-committers@arkaria.postgresql.org; Mon, 13 Mar 2017 19:58:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cnW6u-00066j-Uc for pgsql-committers@arkaria.postgresql.org; Mon, 13 Mar 2017 19:58:28 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cnW6f-0005gp-U9 for pgsql-committers@postgresql.org; Mon, 13 Mar 2017 19:58:13 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cnW6a-0008Tr-O7 for pgsql-committers@postgresql.org; Mon, 13 Mar 2017 19:58:13 +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 v2DJw6QT030882; Mon, 13 Mar 2017 15:58:06 -0400 From: Tom Lane To: Peter Eisentraut cc: David Rowley , pgsql-committers@postgresql.org Subject: Re: pgsql: dblink: Replace some macros by static functions In-reply-to: <45e87bd8-6840-7249-73fa-4238a634c6c9@2ndquadrant.com> References: <45e87bd8-6840-7249-73fa-4238a634c6c9@2ndquadrant.com> Comments: In-reply-to Peter Eisentraut message dated "Mon, 13 Mar 2017 15:45:43 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <30880.1489435086.1@sss.pgh.pa.us> Date: Mon, 13 Mar 2017 15:58:06 -0400 Message-ID: <30881.1489435086@sss.pgh.pa.us> X-Pg-Spam-Score: -2.3 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org Peter Eisentraut writes: > On 3/12/17 17:44, David Rowley wrote: >> Please accept a small patch which fixes a new compiler warning which >> started as a result of this commit. > Done. > Which compiler is that? Any compiler that didn't support pg_attribute_noreturn() could be expected to whine about the original coding. In the same vein, I think this bit in dblink_open is pretty poor coding practice: if (!rconn || !rconn->conn) dblink_conn_not_avail(conname); else conn = rconn->conn; as it expects both the compiler and the reader to understand that we will not proceed without "conn" getting a value. I see that that was band-aided around by initializing conn to NULL, but that's a crummy way of suppressing uninitialized-variable warnings, because it will mask even actual errors. Far better would be to remove the dummy initialization and write if (!rconn || !rconn->conn) dblink_conn_not_avail(conname); conn = rconn->conn; regards, tom lane -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers