Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Because static analyzers today are imprecise. We're considering where this makes sense to turn on in Android, and even within the Linux kernel.


If 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.


We do. Also, the people who built msan are literally the ones implementing the initialization patterns.


Nice, 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: