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: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: warnings for invalid function casts
Date: Sat, 04 Jul 2020 10:16:07 -0400
Message-ID: <1183184.1593872167@sss.pgh.pa.us> (raw)
In-Reply-To: <d04f3b48-8195-aa83-8862-b6d3747fed30@2ndquadrant.com>
References: <1e97628e-6447-b4fd-e230-d109cec2d584@2ndquadrant.com>
	<474790.1593526505@sss.pgh.pa.us>
	<20200630192135.nwlza2u57dy3qej4@alap3.anarazel.de>
	<496552.1593545900@sss.pgh.pa.us>
	<c764383a-3f9e-f5ba-79d1-8824fe73340f@2ndquadrant.com>
	<931660.1593787200@sss.pgh.pa.us>
	<d04f3b48-8195-aa83-8862-b6d3747fed30@2ndquadrant.com>

Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> Do people prefer a typedef or just writing it out, like it's done in the 
> Python code?

I'm for a typedef.  There is *nothing* readable about "(void (*) (void))",
and the fact that it's theoretically incorrect for the purpose doesn't
exactly aid intelligibility either.  With a typedef, not only are
the uses more readable but there's a place to put a comment explaining
that this is notionally wrong but it's what gcc specifies to use
to suppress thus-and-such warnings.

> But if we prefer a typedef then I'd propose 
> GenericFuncPtr like in the initial patch.

That name is OK by me.

			regards, tom lane





view thread (12+ messages)  latest in thread

Message-ID: <1183184.1593872167@sss.pgh.pa.us>
Permalink:  ../1183184.1593872167@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1183184.1593872167@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, andres@anarazel.de
  Subject: Re: warnings for invalid function casts
  In-Reply-To: <1183184.1593872167@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