[comp.lang.c] C syntax

hydrovax@nmtsun.nmt.edu (M. Warner Losh) (02/07/88)

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