Re: warnings for invalid function casts - Mailing list pgsql-hackers

From Tom Lane
Subject Re: warnings for invalid function casts
Date
Msg-id 1183184.1593872167@sss.pgh.pa.us
Whole thread Raw
In response to Re: warnings for invalid function casts  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: warnings for invalid function casts
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: pg_read_file() with virtual files returns empty string
Next
From: "movead.li@highgo.ca"
Date:
Subject: Re: POC and rebased patch for CSN based snapshots