2 ms·
As of C17, adding a volatile qualifier like that doesn't do anything useful. The standard currently only requires that accesses to volatile objects be handled s
by josephcsible 5y ago
As of C17, adding a volatile qualifier like that doesn't do anything useful. The standard currently only requires that accesses to volatile objects be handled specially, not accesses to nonvolatile objects through volatile-qualified pointers. A lot of people, including Linus Torvalds [1], are unhappy that this is how it works, and it looks like DR 476 may finally change it in C2x.
[1]: https://lore.kernel.org/lkml/Pine.LNX.4.64.0607060856080.12404@g5.osdl.org/ https://lore.kernel.org/lkml/Pine.LNX.4.64.0607060856080.124...