Am Wed, 26 Nov 2014 00:28:52 +1100 schrieb "Daniel Murphy" <[email protected]>:
> "Johannes Pfau" wrote in message news:[email protected]... > > > 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? > Is taking addresses on properties still undefined? Or how exactly is it defined? Anyway, &PORTB returns the address of the PORTB function which is a small annoyance.
