4 ms·
Actually clang has a static analyzer that is free and pretty usable. Additionally, I religiously use `-Weverything -Werror` for C and specifically disable warn
by halosghost 11y ago
Actually clang has a static analyzer that is free and pretty usable.
Additionally, I religiously use `-Weverything -Werror` for C and specifically disable warnings I know to be false positives. People have told me that it is excessive, but I have found that it leads me to write dramatically more stable code in the long run.
Clang is also planning to add some additional options in the style of -fsanitize that will allow for compile-time checking and failure on detection of undefined behavior. That is a feature I am incredibly excited for! Having runtime-checks for UB is nice, but bloats the resulting executable quite a bit (not to mention the performance penalty). But having compile-time checks would be awesome; adds a little more work for me if I've been relying on UB, but makes the code better in the long run and doesn't affect run-time unless the change was necessary anyway.