Newsgroups: comp.std.c
Path: utzoo!henry
From: henry@zoo.toronto.edu (Henry Spencer)
Subject: Re: typedefing functions (Re: Is typedef char BUFFER[20] legal?)
Message-ID: <1991Feb4.234441.17203@zoo.toronto.edu>
Organization: U of Toronto Zoology
References: <1212@tredysvr.Tredydev.Unisys.COM> <1991Jan29.210100.8105@zoo.toronto.edu> <22642@netcom.UUCP> <1991Feb3.000128.15980@zoo.toronto.edu> <1991Feb4.053613.3758@watmath.waterloo.edu> <ENAG.91Feb4192806@holmenkollen.ifi.uio.no>
Date: Mon, 4 Feb 1991 23:44:41 GMT

In article <ENAG.91Feb4192806@holmenkollen.ifi.uio.no> enag@ifi.uio.no (Erik Naggum) writes:
>you can say
>	typedef int f (int a, char *b);
>and later say
>	f foo, bar, zot;
>and
>	f *functab[3] = { foo, bar, zot, };

Correct so far.

>The functions would be declared
>	f foo
>	{ ... }

Nope, wrong.  The function definition itself must contain an explicit
function declarator; it cannot inherit its "functionness" from a typedef.
See Constraints in 3.7.1.
-- 
"Maybe we should tell the truth?"      | Henry Spencer at U of Toronto Zoology
"Surely we aren't that desperate yet." |  henry@zoo.toronto.edu   utzoo!henry
