Implicit enum conversions are a stupid PITA
bearophile
bearophileHUGS at lycos.com
Fri Mar 26 07:28:17 PDT 2010
Nick Sabalausky:
>A *lot* of D's design has already been based around the idea of C code doing either the same thing or erroring when compiled for D. Plus, Walter loves that strategy, and hates extra warnings. I'd love for it to happen, but I guess I'm just saying "I ain't holdin my breath!" <
This is not the same situation. As far as I know Walter doesn't like warnings for D code. But this compiler switch is not designed for D code, it's strictly designed for C code just ported to D, to warn in the porting of some possible traps/bugs, like:
- global floats not initialized to 0.0 (this has caused a bug in code of mine translated from C);
- fixed sized-arrays passed by value;
- etc.
Walter doesn't like warnings for example because there are shops that have a zero warning policy, they consider C compiler warnings as errors (and this is silly, I agree with Walter). But those warnings have no purpose for normal D code, they are not designed for D code, they are designed for C code that just looks like D.
Bye,
bearophile
More information about the Digitalmars-d
mailing list