4 ms·
I got up to slide 80, it was really fun; although i'm not sure if the 'knowledge' given in this slide is of really high importance (for example, it explains tha
by flavio81 9y ago
I got up to slide 80, it was really fun; although i'm not sure if the 'knowledge' given in this slide is of really high importance (for example, it explains that static variables are automatically set to 0 upon declaration; i'd better wish my team would always make sure variables are initialized after declaration, unless for performance reasons.)
- alxlaz 9y agoIt's a useful knowledge to have in the sense that it implies these variables are stored in the BSS section. Unless there are highly specific reasons why one would do this, though, I certainly agree that relying on this property is not a good idea. It can be useful, though. Many years ago, we used it to trim the twenty bytes or so that prevented an updated version of our firmware from fitting into the tiny flash space of a device that had been on the market for quite some time. It is at the very least useful to know it when debugging code written by programmers who thought this feature was nice and relied on it throughout the code (either because they thought it was a good optimization to make, or because it further obfuscated their code and thus contributed to the security of their jobs).