Bug 116 – Inline Assembler offset keyword

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-04-27T21:25:00Z
Last change time
2014-02-15T02:14:26Z
Keywords
accepts-invalid, diagnostic, wrong-code
Assigned to
bugzilla
Creator
lugaidster

Comments

Comment #0 by lugaidster — 2006-04-27T21:25:03Z
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)
Comment #2 by thomas-dloop — 2007-01-01T04:25:20Z