DIP62: Volatile type qualifier for unoptimizable variables in embedded programming

Johannes Pfau via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 16 06:02:36 PDT 2014


Am Tue, 15 Jul 2014 19:44:51 +0200
schrieb Artur Skawina via Digitalmars-d <digitalmars-d at puremagic.com>:

> it originally and also the gdc ml discussion that followed. I have
> not seen any good argument for introducing a volatile type qualifier.
> Could you show one (concrete) example where using 'volatile' is better
> than my approach?
> 
> artur

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;


More information about the Digitalmars-d mailing list