the compiler is the one actually allocating the variable in SRAM (on the stack here), you are not giving an address of anything ➜ it knows it's not hardware related
if you were to define it as a pointer to somewhere in memory and pass the address then I would agree