Yet another slap on the hand by implicit bool to int conversions

bearophile bearophileHUGS at lycos.com
Sun Jun 19 16:42:22 PDT 2011


Timon Gehr:

> Maybe DMD could warn on nonsense of the form x != x.

Right. This thread is very good food for this enhancement request of mine:
http://d.puremagic.com/issues/show_bug.cgi?id=5540

Vote for this enhancement :-)

----------------------

Peter Alexander:

> That would help in this particular case, but not in general.

Experience (there are even articles written on this, with statistics) shows this is a a common class of bug, and for a compiler it's easy to catch such bugs. So while not being very general as you want, it's general enough to justify a compiler test for such things. I hope D will catch similar things.

Bye,
bearophile


More information about the Digitalmars-d mailing list