January 21, 2005
Well, I've been trying to do file I/O... the only problem is, dmd 0.110 refuses
to allow the conversion from void* to int*, which I find extremely bizarre...
How can   one do file I/O with only the ability to read text (Write, on the
other hand, works fine, since int[] to void[] is of quite workable.)
Have I missed something here? Or is pointer manipulation truly disabled, and I
failed to notice in the documentation?


January 22, 2005
BreMac schrieb in news:csrmfk$oof$1@digitaldaemon.com :
> Well, I've been trying to do file I/O... the only problem is, dmd 0.110 refuses
> to allow the conversion from void* to int*, which I find extremely bizarre...
> How can   one do file I/O with only the ability to read text (Write, on the
> other hand, works fine, since int[] to void[] is of quite workable.)
> Have I missed something here? Or is pointer manipulation truly disabled, and I
> failed to notice in the documentation?

I currently don't have dmd 0.110 at hand, but the sample below used to work.

#import std.c.stdlib;
#
#int main(){
#    int* x;
#    x = cast(int*) malloc(int.sizeof * 2);
#    *x = 13;
#    *(x+1) = 0;
#    void* y = x;
#    int* z = cast(int*) y;
#    assert(*z==13);
#    assert(*(z+1)==0);
#    return 0;
#}

If this fails with the lates dmd version then please send a bug report.

Thomas