Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!xanth!mcnc!rti!sunpix!matthew From: matthew@sunpix.UUCP ( Sun NCAA) Newsgroups: comp.lang.c Subject: Re: warning: ambiguous assignment: assignment op taken Summary: Its a wonder what a single space will do... Message-ID: <410@greens.UUCP> Date: 9 Mar 89 16:33:21 GMT References: <859@rpi.edu> Distribution: usa Organization: Sun Microsystems, Research Triangle Park, NC Lines: 27 In article <859@rpi.edu>, entropy@pawl.rpi.edu (Math Student from Hell) writes: [complaint about (a=-b;) != (a = -b;) deleted.] Think, at the time the compilers you are complaining about where originally written, the (a =- b;) construct was still a problem. Old code was still being recompiled to run under new machines, I'd rather have a compiler complain about a possible problem, than to have it compile without a single complaint and have the program give me an incorrect result. With or without warning messages, which is easier to debug? By the way, The version of compiler you are using must be pre-4.0. I compiled your program under SunOS 4.0.1 and it did not complain, and it did give me the correct answer of: a=-5 b=5. Editing the source to remove the ambiguity ( i.e. change (a=-b;) to (a = -b;)) resolves the problem under SunOS 3.4 and 3.5. Atleast with the warning messages you know which lines to edit. -- Matthew Lee Stier | Sun Microsystems --- RTP, NC 27709-3447 | "Wisconsin Escapee" uucp: { sun, mcnc!rti }!sunpix!matthew | phone: (919) 469-8300 fax: (919) 460-8355 |