DIP62: Volatile type qualifier for unoptimizable variables in embedded programming

Kagamin via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 16 06:51:48 PDT 2014


On Wednesday, 16 July 2014 at 13:04:37 UTC, Johannes Pfau wrote:
> I experimented a little more with Volatile!T and I don't think 
> you can
> make this example work:
>
> struct Timer
> {
>     uint control;
>     uint data;
> }
>
> enum timerA = (Volatile!Timer)* = cast()0xDEADBEAF;
>
> timerA.control |= 0b1;

The actual code is a little different: 
http://forum.dlang.org/thread/lq3kq8$pa3$1@digitalmars.com?page=5#post-fkgjcnqyoqltftbfmwqd:40forum.dlang.org


More information about the Digitalmars-d mailing list