3 ms·
This is why volatile function parameters are deprecated in C++20. It's basically nonsensical to begin with. It sounds like the author of the code expected that
by klodolph 5y ago
This is why volatile function parameters are deprecated in C++20. It's basically nonsensical to begin with.
It sounds like the author of the code expected that the argument would get a memory location on the stack somewhere, but this behavior isn't actually mandated by the standard. If a variable is placed in a register, then "reading" it is a no-op.
- gpderetta 5y agoInteresting that they are deprecated because volatile locals have specific guarantees with regard to longjmp.