Path: utzoo!attcan!uunet!husc6!bu-cs!buengc!bph From: bph@buengc.BU.EDU (Blair P. Houghton) Newsgroups: comp.lang.c Subject: Re: help with a MESSY C definition!!? Message-ID: <1530@buengc.BU.EDU> Date: 25 Nov 88 19:44:11 GMT References: <207600008@s.cs.uiuc.edu> <1506@buengc.BU.EDU> <950@vsi.COM> Reply-To: bph@buengc.bu.edu (Blair P. Houghton) Followup-To: comp.lang.c Organization: Boston Univ. Col. of Eng. Lines: 32 In article <950@vsi.COM> friedl@vsi.COM (Stephen J. Friedl) writes: >In article <1506@buengc.BU.EDU>, bph@buengc.BU.EDU (Blair P. Houghton) writes: >> Now, prove that >> >> (int *(*)()) >> >> is unambiguously "cast to pointer to function returning pointer >> to int" and never misinterpreted as "cast to function returning pointer >> to pointer to int," whatever the hell that means... > >Casts are "abstract declarations". This means that if you drop the >outer parens, there is exactly one place where a variable name (say, >`foo') could be inserted to make this a real declaration. Above, >the only place would be: > > int *(*foo)() > >So, this is "cast to ptr to function returning ptr to int". But is there anything illegal about int *(*)foo() and would those "extra" parentheses change the precedence of that * declarator at all, viz double *barz[] /* declare barz as array of ptr to double */ double (*)barz[] /* declare barz as ptr to array of double. Or does it? */ --Blair