Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!ginosko!uunet!twwells!bill From: bill@twwells.com (T. William Wells) Newsgroups: comp.lang.c Subject: Re: precedence of && (was: precedence of ?:) Message-ID: <1989Sep15.200440.4796@twwells.com> Date: 15 Sep 89 20:04:40 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> Organization: None, Ft. Lauderdale, FL Lines: 38 In article <3263@solo5.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes: : bill@twwells.com (T. William Wells) writes: : \... a ? b : c = d : \ : \can't be parsed as (a ? b : c) = d, since a ? b : c isn't a : \unary-expression. It can, however, be parsed as a ? b : (c = d). As : \far as I know, there are no compilers that this breaks on. : \ : \Similarly one analyzes a && b = c: : : 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! Yes. I was brain-dead on that one. I *know* how to read those damn things. And I know that that bit of code won't work. But I was asleep at the wheel. Somehow I reversed what I was going to say and just continued writing with the negation substituted for what I intended. Sorry. You may take the flames I usually reserve for others as having been directed at myself. That paragraph should have said that a ? b : c = d is also not valid because c = d is not a conditional-expression and so is not legal C. And will not parse on any compiler I know of. --- Bill { uunet | novavax | ankh | sunvice } !twwells!bill bill@twwells.com