Is this a bug ?

bearophile bearophileHUGS at lycos.com
Thu Nov 28 17:35:29 PST 2013


Adam D. Ruppe:

>> write(" %d: %d\n", bd, an);
>
> This should be writef instead of write. writef uses the format 
> string, plain write just literally outputs its arguments.

A statically typed language should give a compile-time error for 
such mistake. It's a leftover from the weakly typed C mindset. In 
many cases format strings are known at compile-time.

Bye,
bearophile


More information about the Digitalmars-d mailing list