Clang’s static analyzer has become quite popular with developers for C/C++ static analysis of code while now the GNU Compiler Collection (GCC) might finally see a mainline option thanks to Red Hat. Red Hat’s David Malcolm has proposed a set of 49 patches that appear to be fairly robust and the most we have seen out of GCC static analysis capabilities to date.
This GCC static analysis framework can easily report use after free errors, double frees, and other common C coding issues that are detectable via static analysis. The implementation is quite interesting and opens the doors for GCC a lot but in using this –analyzer pass roughly doubles the compile times.
[Source: Phoronix]