3 ms·
I’ve found that of the best ROIs for any existing large C/C++-using-C codebase is meticulously going through the compiler warning options and enabling all of th
by apaprocki 6y ago
I’ve found that of the best ROIs for any existing large C/C++-using-C codebase is meticulously going through the compiler warning options and enabling all of the things that didn’t make the cut into -Wall or even -Wextra. After getting strict warnings under control and making them CI errors, again meticulously go attribute all varargs printf-style functions with the appropriate format attributes. Those two things have always been such a reachable goal even for one person and prevent everyone else touching the code from introducing sneaky bugs that slip past review. The newer compilers now check and can error if the maximum range for a value would exceed the buffer space you’ve given it, even if you think those values could never occur in practice.