3 ms·
How would you do something like this [1] using those? [1] https://godbolt.org/z/Aj5bJ8 https://godbolt.org/z/Aj5bJ8
by FartyMcFarter 7y ago
How would you do something like this [1] using those?
[1] https://godbolt.org/z/Aj5bJ8 https://godbolt.org/z/Aj5bJ8
- amluto 7y agoI would argue that this particular example is useless. A volatile variable at file scope can easily be IO memory. A volatile static at function scope? Not so easy.
- FartyMcFarter 7y agoIt can be set by a debugger for example. In any case, the scope of the variable was not the point of the question. The behaviour doesn't really change if you make the variable a static file-scoped one.