Re: Why does load_external_function() return PGFunction? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Why does load_external_function() return PGFunction?
Date
Msg-id 30501.1517949809@sss.pgh.pa.us
Whole thread Raw
In response to Why does load_external_function() return PGFunction?  (Andres Freund <andres@anarazel.de>)
Responses Re: Why does load_external_function() return PGFunction?  (Andres Freund <andres@anarazel.de>)
Re: Why does load_external_function() return PGFunction?  (Andres Freund <andres@anarazel.de>)
Re: Why does load_external_function() return PGFunction?  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> We've several callers to load_external_function() that do not use the
> returned value as a PGFunction. I'd vote for changing the return type to
> void * and have fmgr.c cast it to PGFunction after verifying the
> function's magic.

void* isn't necessarily compatible with function pointers --- there are
platforms where they're physically different widths, though possibly
you'd never get PG to run on such hardware anyway.

I'd be OK with declaring it as a more generic function pointer type,
perhaps "void (*funcptr) ()".

However, given that a cast is going to be necessary anyway, it seems
like this is mostly useless churn...

            regards, tom lane


pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Add PGDLLIMPORT to enable_hashagg
Next
From: Stefan Kaltenbrunner
Date:
Subject: Re: git instructions