Writing Bug-Free C/D Code

David B. Held dheld at codelogicconsulting.com
Tue Mar 20 01:18:24 PDT 2007


Derek Parnell wrote:
> [...]
>  void main()
>  {
>    age x;
>    len y;
>    float z = 4.321;
> 
>    x = 10;
>    y = 5;
>    //y = z; // fails but probably shouldn't

I disagree.  Consider:

int x = 15;
months m = x; // Sound?

>    //y = x; // correctly fails.
>    y += x;  // incorrectly works.
> [...]

Ouch.

Dave



More information about the Digitalmars-d mailing list