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

From Andres Freund
Subject Re: Why does load_external_function() return PGFunction?
Date
Msg-id 20180326183136.4bv7ebwzvi6iwcfl@alap3.anarazel.de
Whole thread Raw
In response to Re: Why does load_external_function() return PGFunction?  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Why does load_external_function() return PGFunction?  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On 2018-03-26 11:14:03 -0400, Robert Haas wrote:
> On Sat, Mar 24, 2018 at 4:33 PM, Andres Freund <andres@anarazel.de> wrote:
> > I don't think it really changes the need, but it's worthwhile to note
> > that gcc-8 warns about this now:
> > /home/andres/src/postgresql/src/backend/postmaster/bgworker.c: In function ‘LookupBackgroundWorkerFunction’:
> > /home/andres/src/postgresql/src/backend/postmaster/bgworker.c:1246:9: warning: cast between incompatible function
typesfrom ‘PGFunction’ {aka ‘long unsigned int (*)(struct FunctionCallInfoData *)’} to ‘void (*)(Datum)’ {aka ‘void
(*)(longunsigned int)’} [-Wcast-function-type]
 
> >   return (bgworker_main_type)
> 
> That's probably going to mean we need, or at least want, to do
> something about this at some point.  Warning-free compiles are
> desirable.

Right. We can suppress those if we want, either by adding another cast,
or by adding -Wno-cast-function-type. The latter wouldn't be entirely a
bad idea, it seems to be a warning of very limited benefit.

Greetings,

Andres Freund


pgsql-hackers by date:

Previous
From: "Daniel Verite"
Date:
Subject: Re: Re: csv format for psql
Next
From: Andres Freund
Date:
Subject: Re: Why does load_external_function() return PGFunction?