DIP62: Volatile type qualifier for unoptimizable variables in embedded programming

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


On 15 July 2014 22:17, Iain Buclaw <ibuclaw at gdcproject.org> wrote:
> 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.
>

I say safe in the lightest possible terms.  Volatile is in no way @safe.


More information about the Digitalmars-d mailing list