Hacker News new | ask | show | jobs
by jcranmer 2916 days ago
Compilers are free to delete global variables, if nothing references them, just like local variables. That said, if you don't declare them static or some other form of private variable, then compilers generally need to assume that some unknown entity can refer to them, which generally prevents their removal.