The GCC project has traditionally made major releases yearly in the March/April timeframe. March is rapidly approaching and the GCC project’s engineers are busy polishing things up for the GCC 6 release. I’m going to take a short break from my own release efforts to briefly talk about some of the new features.
Warnings GCC strives to implement warnings which help developers catch errors at compile time rather than allow potentially dangerous code to be silently accepted and ultimately deployed. For GCC 6, the major warning additions are:
Misleading indentation: The goal of the misleading indentation warning is to detect code where the block structure likely does not match how a human would read the code. The most obvious example is the the “Apple SSL bug” from 2014 where mis-indented code made it look like a GOTO was guarded by a prior IF conditional, when in fact it was not guarded at all. This will be covered in more detail in a blog post from David Malcolm.
Tautological comparisons: Code which compares an object to itself and which always evaluates to the same result often represents a typo/bug in the source code. GCC 6 will now warn for such comparisons.
Continue reading “Upcoming features in GCC 6”