Tips from the compiler

bearophile bearophileHUGS at lycos.com
Tue Oct 19 18:25:49 PDT 2010


Don:

> We should have a warning that 'a*5' may cause a numeric overflow. How 
> can that be done?

Once the D2 compiler is able to test for (separated) signed/unsigned overflows both at compile and run-time, then the compile-time ones are hard errors, and the run-time ones are exceptions (in CTFE they may be CT exceptions).

After that basic safety net functionality is present, and D smells less of bugs than before, you may want the compiler, when it's unsure if an overflow may occur, to raise a warning instead, but I think this kind of warnings are not so important.

Bye,
bearophile


More information about the Digitalmars-d mailing list