The compiler confuses offset keyword in the inline assembler with .offsetof property and issues a deprecated keyword error. This is easily reproduced by compiling the following:
CODE:
int[5] bar;
void foo()
{
asm
{
mov ECX,offset bar;
}
}
a workaround would be to do this:
int[5] bar;
void foo()
{
void* pbar = &bar;
asm
{
mov ECX,pbar;
}
}
after issuing the error it says to use offsetof instead, and when you write:
int[5] bar;
void foo()
{
asm
{
mov ECX,offsetof bar;
}
}
it compiles and runs until a runtime error is issued.
Comment #1 by bugzilla — 2006-06-20T02:18:45Z
Fixed DMD 0.161 (there was a bug in the offsetof implementation, but still offsetof is preferred to offset)