Mail Archives: djgpp/1996/12/02/23:36:40
is the ambiguity not worthy of some warning then? particularly under -wall?
i spent ages tracking this bug down :(
your theory may be right actually, i was able to determine that the behavior was
wrong but that the c==0 part worked, so your analysis may well be correct.
nik
|> ok, i'll give this a try but i may be totally wrong.
|>
|> here is what seems like a logical explanation to me. assume that the
|> compiler, when processing your code, uses a 'maximal munch' rule, i.e.,
|> it always considers the longest possible character sequence that is
|> meaningful in the context. so, now suppose the compiler is at the
|> beginning of a==b==c==0. what is the maximal meaningful substring? it is
|> a==b. what is the next one. it seems to be that's ==. what is the one
|> after that? well, c==0. so, a==b==c==0 gets interpreted as
|> (a==b) == (c==0) (which is not (a==b) && (c==0).)
|>
|> this seems like a logical explanation to me. however, i won't be able to
|> test it for a couple of days. sorry for the unsubstantiated claims.
|>
|> sinan.
--
- Raw text -