[Bug 116] New: Inline Assembler offset keyword
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Apr 27 19:25:04 PDT 2006
http://d.puremagic.com/bugzilla/show_bug.cgi?id=116
Summary: Inline Assembler offset keyword
Product: D
Version: 0.155
Platform: PC
OS/Version: Windows
Status: NEW
Keywords: accepts-invalid, diagnostic, wrong-code
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: lugaidster at gmail.com
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.
--
More information about the Digitalmars-d-bugs
mailing list