Path: utzoo!attcan!uunet!ginosko!usc!rutgers!mit-eddie!uw-beaver!ubc-cs!alberta!oha!tony From: tony@oha.UUCP (Tony Olekshy) Newsgroups: comp.lang.c Subject: Re: on the fringe of C syntax/semantics Summary: cdecl *does* allow declaration of argument types! Message-ID: <334@oha.UUCP> Date: 14 Oct 89 20:07:08 GMT References: <789@crdos1.crd.ge.COM> <457@usage.csd.unsw.oz> <20077@mimsy.UUCP> Reply-To: tony@oha.UUCP Organization: Olekshy Hoover & Associates Ltd., Edmonton, Alberta, Canada. Lines: 33 In-Reply-To: Message <20077@mimsy.UUCP> dated 9 Oct 89 18:59:09 GMT Return-Path: In message <20077@mimsy.UUCP>, chris@mimsy.UUCP (Chris Torek) writes: > > One can use the freely-available (possibly public domain) `cdecl' > program to come up with things like [...] > > char **(*(**(*(*(*(*(*foo)())())[3])())[4][2])())[5] > > Of course, in ANSI C, one should include the types of the arguments to > each of the functions.... FYI: (echo `cat` | cdecl) << \_end_ declare foo as pointer to function (a,b) returning pointer to function (c, d) returning pointer to array 3 of pointer to function (e, f) returning pointer to array 4 of array 2 of pointer to pointer to function (g, h) returning pointer to array 5 of pointer to pointer to char _end_ Generates: char **(*(**(*(*(*(*(*foo)(a, b))(c, d))[3])(e, f))[4][2])(g, h))[5] So, isn't: typedef int a, b, c, d, e, f; (char **(*(**(*(*(*(*(*)(a, b))(c, d))[3])(e, f))[4][2])(g, h))[5])x; ok? -- Yours, etc., Tony Olekshy (...!alberta!oha!tony or tony@oha.UUCP).