typedefing functions (Re: Is typedef char BUFFER[20] legal?)

Avery Colter avery at netcom.COM
Fri Feb 8 06:09:44 AEST 1991


datangua at watmath.waterloo.edu (David Tanguay) writes:

>Our compiler had a neat bug with this. It would accept, e.g., 

>	typedef int f( int a ) { return a+1; }

Hmmmmm......

Ya meeeeeeeeen.......

I could just see this:

f foo;

foo is a function with an int parameter returning an int,
AND has the statement body {return a+1;}!

Probably not legal, but hey, I've been wrong before this week. :P

-- 
Avery Ray Colter    {apple|claris}!netcom!avery  {decwrl|mips|sgi}!btr!elfcat
(415) 839-4567   "I feel love has got to come on and I want it:
                  Something big and lovely!"         - The B-52s, "Channel Z"



More information about the Comp.std.c mailing list