logoalt Hacker News

eqvinoxyesterday at 4:03 PM1 replyview on HN

Using the "register" storage class feels really alien for C code written in 2025…


Replies

flohofwoeyesterday at 10:35 PM

It has a slightly different meaning now, instead of hinting to the compiler that the variable should be placed in a register it now means that it is illegal to take the address of the variable (e.g. cannot create a pointer from it):

https://www.godbolt.org/z/eEYf5c59f

Might be useful in some situations although I currently can't think of any :)

show 1 reply