Re: style for typedef of function that will be pointed to

From: Chapman Flack <chap(at)anastigmatix(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: style for typedef of function that will be pointed to
Date: 2021-10-05 18:00:22
Message-ID: 615C92B6.2090109@anastigmatix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2021-10-05 19:06:07 Re: Next Steps with Hash Indexes
Previous Message Antonin Houska 2021-10-05 17:57:21 Re: storing an explicit nonce