Nasty -O bug

Matti Niemenmaa see_signature at for.real.address
Thu Jan 17 01:32:04 PST 2008


bobef wrote:
> downs Wrote:
>> bobef wrote:
>>> Also this thing (no matter of the -O flag):
>>>
>>> auto a=FOCUS_LOST|SINKING;
>>> if(p.cmd==a) {...}
>>>
>>> works, but not this:
>>>
>>> if(p.cmd==FOCUS_LOST|SINKING) {...}
>>>
>> Purely out of interest, could you try this:
>>> if (p.cmd == (FOCUS_LOST|SINKING))
>>  --downs
> 
> "if (p.cmd == (FOCUS_LOST|SINKING))" works.

And it's meant to, and the other isn't, because the precedence of == is higher 
than the precedence of |.

IMHO it's stupid legacy, dating back to B (yes, B!), but what can you do.

-- 
E-mail address: matti.niemenmaa+news, domain is iki (DOT) fi


More information about the Digitalmars-d-bugs mailing list