Path: utzoo!mnetor!uunet!husc6!bloom-beacon!gatech!rutgers!mtunx!whuts!homxb!genesis!hotlr!dkc From: dkc@hotlr.ATT (Dave Cornutt) Newsgroups: comp.lang.c Subject: Re: ambiguous why? Message-ID: <270@hotlr.ATT> Date: 8 Apr 88 23:07:42 GMT References: <1303@PT.CS.CMU.EDU> Reply-To: dkc@hotlr.UUCP (Dave Cornutt) Organization: Not much, but I'm working on it Lines: 36 In article <1303@PT.CS.CMU.EDU> edw@IUS1.CS.CMU.EDU (Eddie Wyatt) writes: > When I was playing around with that last example I posted, I got an > error message that said something to the extent: > > warning ambiguous assigment: assignment op taken > syntax error at or near symbol *= > > A simplified version of the statement is: > > int *a, *b; > > *a+=*b; > > I thought that this should not be ambiguous since the lexer scans left to right. > Is there some l to r rule that disambiguates this statement or did I > just make it up? The tipoff is the "*=" in the error message. You have a compiler that still recoginzes the old turned-around operator syntax. (Back in the bad old days, this statement: a =- b used to mean "subtract b from a and assign the result to a", where it now means "negate b and assign that value to a". If you put a space in between the '=' and the '*', that should get your compiler to shut up. (P.S: Is dpANS finally going to get rid of this? I hope so.) -- Dave Cornutt, AT&T Bell Labs (rm 4A406,x1088), Holmdel, NJ UUCP:{ihnp4,allegra,cbosgd}!hotly!dkc "The opinions expressed herein are not necessarily my employer's, not necessarily mine, and probably not necessary"