pg.ddx.io  pgsql-hackers@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: Michael Paquier <michael.paquier@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: assorted code cleanup
Date: Tue, 05 Sep 2017 15:32:27 -0400
Message-ID: <11524.1504639947@sss.pgh.pa.us> (raw)
In-Reply-To: <f52c16db-14ed-757d-4b48-7ef360b1631d@2ndquadrant.com>
References: <2beab0ef-69f9-dab3-cacd-8fdf417bca96@2ndquadrant.com>
	<CAB7nPqQHnB_qS41P+Vsi=CrE3L2rjp37F8WX-dJceLzEWO+rvw@mail.gmail.com>
	<f52c16db-14ed-757d-4b48-7ef360b1631d@2ndquadrant.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> Do you mean specifically the hook variables, or any function pointers?
> I can see your point in the above case, but for example here

> -       if ((*tinfo->f_lt) (o.upper, c.upper, flinfo))
> +       if (tinfo->f_lt(o.upper, c.upper, flinfo))

> I think there is no loss of clarity and the extra punctuation makes it
> more complicated to read.

At one time there were C compilers that only accepted the former syntax.
But we have already occurrences of the latter in our tree, and no one
has complained, so I think that's a dead issue by now.

I do agree with the idea that we should use the * notation in cases where
the reader might otherwise think that a plain function was being invoked,
ie I don't like

	some_function_pointer(args);

Even if the compiler isn't confused, readers might be.  But in the case of

	structname->pointerfield(args);

it's impossible to read that as a plain function call, so I'm okay with
dropping the extra punctuation there.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (12+ messages)  latest in thread

Message-ID: <11524.1504639947@sss.pgh.pa.us>
Permalink:  ../11524.1504639947@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/11524.1504639947@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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, peter.eisentraut@2ndquadrant.com, michael.paquier@gmail.com
  Subject: Re: assorted code cleanup
  In-Reply-To: <11524.1504639947@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