About const and C functions

Bekenn leaveme at alone.com
Wed Mar 2 10:08:40 PST 2011


On 3/2/11 4:06 AM, bearophile wrote:
>
> Can't D/DMD err on the side of safety and consider the C-style variadic argument as not const, and so produce an error if you give to them something that's D const/immutable (and require a cast there)? (Especially a function like sscanf where the third and successive arguments are known to be modified).
>

With an annotation on the function signature, perhaps, and certainly it 
should do this at all times in code marked @safe.


More information about the Digitalmars-d-learn mailing list