Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!mailrus!utah-gr!utah-cs!donn From: donn@utah-cs.UUCP (Donn Seeley) Newsgroups: comp.lang.c++ Subject: ambiguities in the declaration grammar for cfront Message-ID: <5682@utah-cs.UUCP> Date: 29 Aug 88 23:12:04 GMT Organization: University of Utah CS Dept Lines: 30 The following sort of code makes cfront 1.2.1 bomb out: typedef char ctype; typedef ctype (*cptrtype); The errors typically look like this: "ctype.c", line 2: warning: ctype redefined "ctype.c", line 2: internal <> error: type::dcl(this==0) Cfront works if the parentheses are omitted, but there are situations in which parentheses are necessary: typedef ctype (*cptrarraytype)[10]; In this case, it's necessary to either drop the ctype typedef or to declare the type in two steps like this, carefully avoiding parentheses: typedef ctype carraytype[10]; typedef carraytype *cptrarraytype; Our C compiler, of course, is perfectly happy with these typedefs (although we might tell a different story if our C compiler supported prototypes). Is this fixed in AT&T C++ 2.0? Is there a preferred workaround? This doesn't do much to increase my sympathy toward prototype syntax, Donn Seeley University of Utah CS Dept donn@cs.utah.edu 40 46' 6"N 111 50' 34"W (801) 581-5668 utah-cs!donn