Hacker News new | ask | show | jobs
by planede 1184 days ago
An other one from the standard:

  void trex(volatile short left_arm, volatile short right_arm);   // deprecated
https://eel.is/c++draft/depr.volatile.type#example-3
1 comments

This is one of the surviving improvements from JF Bastien's P1152 which was initially successful in deprecating most of the spurious use of volatile from C++ with a view to some day getting in there and actually doing MMIO properly.

Unfortunately too much of this will be unwound in C++ 23 because WG21 voted to un-deprecate all the volatile compound operators despite knowing nobody could even offer a rationale for why or how most of them would ever be correctly used.

I think [1] explains well why this will be un-deprecated.

[1]: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p23...

Note that P2327 is not what was actually done.

P2327 would be in my "not angry just disappointed" category. Of course WG21 think rotten archaic C code should be valid C++ 23 and the belief from embedded devs who write this stuff that it's probably all fine despite no evidence whatsoever should be enough to sail through committee.

WG21 voted to amend the draft to un-deprecate all of the volatile compound assignments instead, at Kona IIRC.