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

From Chapman Flack
Subject Re: style for typedef of function that will be pointed to
Date
Msg-id 615C92B6.2090109@anastigmatix.net
Whole thread Raw
In response to Re: style for typedef of function that will be pointed to  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: style for typedef of function that will be pointed to  (Chapman Flack <chap@anastigmatix.net>)
List pgsql-hackers
On 10/05/21 13:47, Tom Lane wrote:
>> 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.


It compiles silently for me with gcc --std=c89 -Wpedantic

I think that's the oldest standard I can ask gcc about. Per the manpage,
'c89' is ISO C90 without its amendment 1, and without any gnuisms.

Regards,
-Chap



pgsql-hackers by date:

Previous
From: Antonin Houska
Date:
Subject: Re: storing an explicit nonce
Next
From: Tomas Vondra
Date:
Subject: Re: Next Steps with Hash Indexes