Path: utzoo!mnetor!uunet!husc6!cmcl2!beta!unm-la!unmvax!nmtsun!hydrovax From: hydrovax@nmtsun.nmt.edu (M. Warner Losh) Newsgroups: comp.lang.c Subject: Re: C syntax (was Re: C sintax) Message-ID: <1363@nmtsun.nmt.edu> Date: 7 Feb 88 06:37:45 GMT References: <501@m10ux.UUCP> <165600034@uiucdcsb> Organization: NMT Hydrology program Lines: 18 Summary: This isn't ambiguous In article <165600034@uiucdcsb>, wsmith@uiucdcsb.cs.uiuc.edu writes: > In <548@gtx.com>, al@gtx.com (Alan Filipski) writes: > > I'll stick my neck out and say I don't think there ARE any syntactic > > ambiguities in C. > > Are there any syntactic ambiguities K&R didn't resolve? > printf("%0d",a+++b); > Is this (a++)+b or a+(++b)? According to K&R it is the former. That is it is (a++)+b, since the tokens of the language are taken to be the largest possible token. If you didn't do something like this, then you have all kinds of problems with += and ->. -- bitnet: losh@nmt.csnet M. Warner Losh warner@hydrovax.nmt.csnet ! Don't know if this works, let me know. csnet: warner@hydrovax.nmt.edu uucp: ...{cmcl2, ihnp4}!lanl!unmvax!nmtsun!warner%hydrovax