pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: David Rowley <david.rowley@2ndquadrant.com>
Cc: pgsql-committers@postgresql.org
Subject: Re: pgsql: dblink: Replace some macros by static functions
Date: Mon, 13 Mar 2017 15:58:06 -0400
Message-ID: <30881.1489435086@sss.pgh.pa.us> (raw)
In-Reply-To: <45e87bd8-6840-7249-73fa-4238a634c6c9@2ndquadrant.com>
References: <E1cmLoF-0005x2-GH@gemulon.postgresql.org>
	<CAKJS1f9a=dyzbP3xrn7nHgEk-tNjXKybRV_csJRptzCp=hLCsA@mail.gmail.com>
	<45e87bd8-6840-7249-73fa-4238a634c6c9@2ndquadrant.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Peter Eisentraut <peter.eisentraut@2ndquadrant.com> 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



view thread (5+ messages)  latest in thread

Message-ID: <30881.1489435086@sss.pgh.pa.us>
Permalink:  ../30881.1489435086@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/30881.1489435086@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, peter.eisentraut@2ndquadrant.com, david.rowley@2ndquadrant.com
  Subject: Re: pgsql: dblink: Replace some macros by static functions
  In-Reply-To: <30881.1489435086@sss.pgh.pa.us>
  References: <E1cmLoF-0005x2-GH@gemulon.postgresql.org> <CAKJS1f9a=dyzbP3xrn7nHgEk-tNjXKybRV_csJRptzCp=hLCsA@mail.gmail.com> <45e87bd8-6840-7249-73fa-4238a634c6c9@2ndquadrant.com> <30881.1489435086@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