DMD hackers: pragma(address): Is this possible?

Daniel Murphy via Digitalmars-d digitalmars-d at puremagic.com
Tue Nov 25 05:28:52 PST 2014


"Johannes Pfau"  wrote in message news:m51upj$u2v$1 at digitalmars.com...

> But does this really make sense? What makes a variable a variable? For
> example the GCC backends has builtin support for extern, static, const,
> manifest variables, but no way to specify an address for an extern
> variable. Is there a reason for this?

Makes sense to me.   I image gcc backends don't natively support this 
because it's equivalent to casting to a pointer and dereferencing.

Do we really need it with ref return and force-inline?

pragma(always_inline)
ref ubyte PORTB() @property { return *cast(ubyte*)0x1000; }

That should also result in optimal asm, right? 



More information about the Digitalmars-d mailing list