GCC's New Static Analysis Capabilities Are Getting Into Shape For GCC 10

Written by Michael Larabel in GNU on 27 March 2020 at 01:25 AM EDT. 12 Comments
GNU
One of many new features in the GCC 10 code compiler releasing in about one month's time is finally having a built-in static analyzer. This static analyzer can be enabled with the -fanalyzer switch and has been maturing nicely for its initial capabilities in the GNU Compiler Collection 10.

The static analyzer was added to GCC 10 just back in January with an initial focus on C code. This static analyzer for GCC was spearheaded by GCC's David Malcolm and was available in patch form a few months prior. This static analyzer isn't as mature or robust as what's been built into the likes of LLVM Clang for a while now, but it's getting there.

Malcolm wrote a Red Hat Developer blog post on Thursday outlining the static analyze support for GCC 10.

Of the state right now in GCC Git, Malcolm noted, "It works well for small and medium-sized examples, but there are bugs that mean it’s not ready for production use. I’m working hard on fixing things in the hope that the feature will be meaningfully usable for C code by the time of GCC 10’s release (likely in April)."

Using the GCC -fanalyzer can spot a range of issues and potential warnings. Some future items include further checker improvements around complex state, ensuring the messages aren't too overly verbose, and possible HTML output formatting support.

GCC 10.1 as the first stable version in the GCC 10 series should be out likely around the end of April. One of the first Linux distributions where you'll be able to find GCC 10 by default is Red Hat's release of Fedora 32.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week