Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!ico!ism780c!news From: news@ism780c.isc.com (News system) Newsgroups: comp.lang.c Subject: Re: precedence of && (was: precedence of ?:) Message-ID: <33395@ism780c.isc.com> Date: 15 Sep 89 21:40:55 GMT References: <1265@gmdzi.UUCP> <11030@smoke.BRL.MIL> <11039@smoke.BRL.MIL> <3236@solo10.cs.vu.nl> <11045@smoke.BRL.MIL> <3242@solo12.cs.vu.nl> <11054@smoke.BRL.MIL> <1989Sep14.175841.8086@twwells.com> <3263@solo5.cs.vu.nl> Reply-To: marv@ism780.UUCP (Marvin Rubenstein) Organization: Interactive Systems Corp., Santa Monica CA Lines: 17 In article <3263@solo5.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes: :STOP! Let's do precisely what you said, let's analyze a && b = c :SIMILARLY: : : a && b = c : :"can't be parsed as (a && b) = c, since a && b isn't a :unary-expression. It can, however, be parsed as a && (b = c). As :far as I know, there are no compilers that this breaks on." : :But wait! This example breaks on EVERY compiler! Unfortunately, pcc based compilers accept a && b += c. They do reject a && b = c however. Writing a grammer for the language as was done by ANSI helps avoid these funnies. Marv Rubinstein