Implicit enum conversions are a stupid PITA
Nick Sabalausky
a at a.a
Thu Mar 25 19:55:57 PDT 2010
"Clemens" <eriatarka84 at gmail.com> wrote in message
news:hogss7$11nb$1 at digitalmars.com...
>
> How about a command line argument to DMD which can be used to aid in
> porting legacy C code? It would cause the compiler to generate a warning
> (or error if you wish) for every occurrence of an ambiguous construct like
> this. Once all such cases have been converted to valid D code and the code
> compiles without warnings, the command line argument can be dropped.
>
> This allows D to escape from the C compatibility trap which has encumbered
> C++ so much while still giving safety against subtle bugs while porting
> old code.
I fear it's probably too late for that for D, but I do like it very much. If
I ever make a C-style langauge myself, I'll definitely consider something
like that.
More information about the Digitalmars-d
mailing list