Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: precedence of ?: (was: precedence of && (was: precedence of ?:)) Message-ID: <11087@smoke.BRL.MIL> Date: 17 Sep 89 00:10:40 GMT References: <3236@solo10.cs.vu.nl> <2550103@hpisod2.HP.COM> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 18 In article <2550103@hpisod2.HP.COM> decot@hpisod2.HP.COM (Dave Decot) writes: >Note that it also renders invalid several classes of expression that >were completely correct in K&R I. It wasn't at all clear what was intended by K&R I. >Another interesting effect of the Standard's grammar is that: > k = (!y ? 0 : t = 1); >is valid, but > k = (y ? t = 1 : 0); >is a syntax error, although it had a single unambiguous parse in K&R I. Other way around. I think all existing usage where different compilers always parsed the expressions the same way still work as before. In cases where there were varying interpretations, the Standard now provides a single unambiguous prescription for how to parse the expressions.