Re: style for typedef of function that will be pointed to
| От | Tom Lane |
|---|---|
| Тема | Re: style for typedef of function that will be pointed to |
| Дата | |
| Msg-id | 4080186.1633456064@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | style for typedef of function that will be pointed to (Chapman Flack <chap@anastigmatix.net>) |
| Ответы |
Re: style for typedef of function that will be pointed to
|
| Список | 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 по дате отправления: