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

From Peter Eisentraut
Subject Re: warnings for invalid function casts
Date
Msg-id d04f3b48-8195-aa83-8862-b6d3747fed30@2ndquadrant.com
Whole thread Raw
In response to Re: warnings for invalid function casts  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: warnings for invalid function casts
List pgsql-hackers
On 2020-07-03 16:40, Tom Lane wrote:
> Given that gcc explicitly documents "void (*) (void)" as being what
> to use, they're going to have a hard time changing their minds about
> that ... and gcc is dominant enough in this space that I suppose
> other compilers would have to be compatible with it.  So even though
> it's theoretically bogus, I suppose we might as well go along with
> it.  The typedef will allow a centralized fix if we ever find a
> better answer.

Do people prefer a typedef or just writing it out, like it's done in the 
Python code?

Attached is a provisional patch that has it written out.

I'm minimally in favor of that, since the Python code would be 
consistent with the Python core code, and the one other use is quite 
special and it might not be worth introducing a globally visible 
workaround for it.  But if we prefer a typedef then I'd propose 
GenericFuncPtr like in the initial patch.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: "movead.li@highgo.ca"
Date:
Subject: Re: A patch for get origin from commit_ts.
Next
From: Dilip Kumar
Date:
Subject: Re: new heapcheck contrib module