0
Why register variable's address is allowed
https://www.sololearn.com/compiler-playground/cAqtscflsNXj Refer code above. Why Solo learn allows address of register variable?
3 ответов
+ 7
From what I understand, a register declaration is only a hint to the compiler to bias the optimization. It is not a guarantee that it will be exclusively register. If the compiler determines that it needs to use the stack, then it will. So I would guess that if the code refers to the variable's address, then the compiler will have to ignore the request to make it register-only.
+ 4
This one from SO was kinda inline to Brian's note ...
https://stackoverflow.com/questions/17559774/address-of-register-variable-in-c-and-c
+ 2
Thanks