The register keyword is deprecated and mostly ignored.
But this little part of its documentation on the msdn made me wonder.
The compiler does not accept user requests for register variables; [...] However, all other semantics associated with the register keyword are honored.
What are those other semantics?
For example in C you cannot take the address of an object declared with register specifier.
void foo(void)
{
register int a = 42;
&a; // constraint violation
}
Another example, you cannot use register in a file scope declaration:
register int b = 42; // constraint violation
int main(void)
{
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With