Hacker News new | ask | show | jobs
by klodolph 1840 days 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.

1 comments

Interesting that they are deprecated because volatile locals have specific guarantees with regard to longjmp.