Hacker News new | past | comments | ask | show | jobs | submit login

> UB has no bearing on that. If a variable has never had its address taken, then there's no expectation that it ever be in memory.

there were plenty of programs that expected specific stack layouts and were broken when compilers started optimizing stack spilling/register allocation more aggressively. Remember that register existed as a keyword.

The address taken might have been a useful practical rule for some compiler, but I don't think it was ever endorsed by the standards (except for prohibiting taking the address of a register variable in C).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: