3 ms·
Why not use static code analyzers? You run them in compilation time and warn you of uninitialized variables. Initializing values just because seems wasteful. T
by kartan 7y ago
Why not use static code analyzers? You run them in compilation time and warn you of uninitialized variables.
Initializing values just because seems wasteful. That's why global and static variables are already initialized in this way.
For me it would yet make sense that Gcc allows it even if it's not a very good practice it may have its uses.
- ndesaulniers 7y agoBecause static analyzers today are imprecise. We're considering where this makes sense to turn on in Android, and even within the Linux kernel.
- carlmr 7y agoIf you can I would at least advise running tests using memory sanitizer, which is also built in to newer clang versions. They're much more precise, but only catch problems occurring at runtime. also adress sanitizer for the out of bounds accesses, use after free bugs, memory leaks etc.
- ndesaulniers 7y agoWe do. Also, the people who built msan are literally the ones implementing the initialization patterns.
- carlmr 7y agoNice, sorry, I didn't notice you actually meant working on Android. Great work btw. I've found a few actual bugs with ASan and MSan already. Not once a false positive.