3 ms·
That's what sanitizers are for. Why would you do that manually given the tooling that's freely available? When I make a logic error the absolute ideal situatio
by fc417fc802 2y ago
That's what sanitizers are for. Why would you do that manually given the tooling that's freely available?
When I make a logic error the absolute ideal situation is that the compiler rejects the program. The higher the frequency of that result the better.
- nickpsecurity 2y ago"What I want is a compiler that slaps me when I forget to initialize a proper value, not one that quietly picks a magic value it thinks I might have meant." I believed the claim was about whether a compiler would initialize memory to zero. Whatever I said would be done by the compiler.
- fc417fc802 2y agoI don't see how. In the presence of default initialization the compiler cannot diagnose these things, more or less by definition. Therefore you will be falling back on debugging. UB plus a memory access sanitizer automates the practice that you described.