About const and C functions

Bekenn leaveme at alone.com
Tue Mar 1 20:13:44 PST 2011


On 3/1/2011 2:33 PM, bearophile wrote:
> Do you know why DMD doesn't give a compilation error here?
>
>
> import core.stdc.stdio: sscanf;
> immutable int value = 5;
> void main() {
>      sscanf("10".ptr, "%d".ptr,&value);
> }
>
> Bye,
> bearophile

I'm not sure that's checkable.  I think this falls squarely into the 
realm of "undefined behavior".


More information about the Digitalmars-d-learn mailing list