4 ms·
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
by jcranmer 8y 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.