precedence of && (was: precedence of ?:)

Maarten Litmaath maart at cs.vu.nl
Thu Sep 14 01:36:56 AEST 1989


gwyn at smoke.BRL.MIL (Doug Gwyn) writes:
\... there is no legal way to parse
\	0 && i = 0
\as
\	(0 && i) = 0
\but there is a legal parse as
\	0 && (i = 0)

gcc (ANSI or what?) does accept

	0 ? 0 : i = 0

but it does NOT accept

	0 && i = 0

In fact, I've never used a C compiler that accepted the latter construct.
Of course I fully agree it should be accepted.
-- 
   creat(2) shouldn't have been create(2): |Maarten Litmaath @ VU Amsterdam:
      it shouldn't have existed at all.    |maart at cs.vu.nl, mcvax!botter!maart



More information about the Comp.lang.c mailing list