Path: utzoo!mnetor!uunet!steinmetz!davidsen From: davidsen@steinmetz.steinmetz.ge.com (William E. Davidsen Jr) Newsgroups: comp.lang.c Subject: Re: ambiguous why? Message-ID: <10263@steinmetz.steinmetz.ge.com> Date: 5 Apr 88 20:40:31 GMT References: <1303@PT.CS.CMU.EDU> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Organization: General Electric CRD, Schenectady, NY Lines: 29 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; Older versions of C allowed =+ =* etc as assignment forms. Later versions switched to *= and += so that the unary minus would not be ambiguous. Your compiler is seeing the =* and complaining. Ambiguous to the eye but not the compiler: d = a+++b; The compiler should go left to right and take the longest valid sequence of characters, so the result is: d = a++ + b; Perhaps someone will find the reference in ANSI for this and post it. -- bill davidsen (wedu@ge-crd.arpa) {uunet | philabs | seismo}!steinmetz!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me