C porting command line switch [Was: Re: Implicit enum conversions are a stupid PITA]

bearophile bearophileHUGS at lycos.com
Thu Mar 25 19:39:44 PDT 2010


Clemens:
>a command line argument to DMD which can be used to aid in porting legacy C code?<

That's a nice idea, thank you for inventing it. Time ago I was vaguely thinking about something similar, but not quite.

DMD1 has: -d allow deprecated features

So D2 can grow a command line switch as (or another name):
-ctest
to be used in porting C code to D2.

It probably just activates warnings that can help avoid many C porting bugs.
For example it can warn the programmer that global floats are not initialized to zero, or fixed-sized arrays are passed by value, etc. In theory this new command line switch this can even allow D to improve the syntax of the switch, avoiding the fall-through :-)

Bye,
bearophile



More information about the Digitalmars-d mailing list