Re: style for typedef of function that will be pointed to - Mailing list pgsql-hackers

From Tom Lane
Subject Re: style for typedef of function that will be pointed to
Date
Msg-id 4080186.1633456064@sss.pgh.pa.us
Whole thread Raw
In response to style for typedef of function that will be pointed to  (Chapman Flack <chap@anastigmatix.net>)
Responses Re: style for typedef of function that will be pointed to  (Chapman Flack <chap@anastigmatix.net>)
List pgsql-hackers
Chapman Flack <chap@anastigmatix.net> writes:
> From everything I've seen, the PostgreSQL style seems to be to include
> the * in a typedef for a function type to which pointers will be held:
> typedef void (*Furbinator)(char *furbee);

Yup.

> An alternative I've sometimes used elsewhere is to typedef the function
> type itself, and use the * when declaring a pointer to it:
> typedef void Furbinator(char *furbee);

Is that legal C?  I doubt that it was before C99 or so.  As noted
in the Ghostscript docs you came across, it certainly wouldn't have
been portable back in the day.

> So what I'm curious about is: is there a story to how PG settled on
> the style it uses?

See above.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Jaime Casanova
Date:
Subject: Re: RfC entries in CF 2021-09
Next
From: Antonin Houska
Date:
Subject: Re: storing an explicit nonce