DIP62: Volatile type qualifier for unoptimizable variables in embedded programming

Iain Buclaw via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 15 14:17:29 PDT 2014


On 15 July 2014 22:07, bearophile via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> Johannes Pfau:
>
>
>> Well as described in the DIP it works just like shared from an
>> implementation point of view, so I doesn't add much complexity in the
>> compiler / type system.
>
>
> I am reading blogs about compiler bugs, and I see that the implementation of
> volatile is the buggiest part of GCC/Clang (and the Intel and Microsoft
> compilers). Despite numerous bug fixes, it's still a stubbornly buggy part.
> So it can't be as simple to implement correctly as you say. volatile fights
> against the optimization stages all the time. And I recognize that Walter
> has a significant experience on this topic, perhaps higher than yours.
>

The use of volatile can be buggy in C because there is no other safe
way to do inter-thread communication.


>
>> This just shows the priorities of the project leads:
>> Desktop apps matter, we add @nogc, c++ namespaces, shared, immutable,
>> const, -cov, ...
>> but for embedded systems we won't even add one qualifier.
>
>
> Having priorities is not something to be ashamed of. D has a GC, works only
> on 32+ bits, and several of its features are not meant for embedded systems.
> Even if you can restrict it for such restricted memory and CPU usages, D is
> not designed primarily for them.
>

So your saying that embedded systems don't matter? Shame on you. :o)


More information about the Digitalmars-d mailing list