GCC 14.1, released on May 7, 2024, turns several longstanding C warnings into errors when targeting standards newer than C89. For teams rebuilding older software, the risk extends beyond a compilation failure: GCC’s porting guide warns that the stricter compiler can cause build checks to disable features silently. A completed build may therefore contain less functionality than the same source built with an earlier compiler. [S4][S5]
The problem starts with small test programs that a build system compiles to discover available features. A failed compilation normally tells the configuration script that a feature is missing. With GCC 14, an outdated test program can fail because its C code is rejected, rather than because the capability it checks is absent. GCC’s guide says these failures tend to remove the affected features and their tests together. Passing the tests that remain is therefore not, by itself, evidence that the feature set survived the upgrade. [S5]
For an upgrade trial, GCC recommends comparing config.log, config.h and other generated source files with diff to look for unexpected changes. Those comparisons expose what the configuration process decided, not just whether the final compilation succeeded. The practical check is to investigate a newly disabled feature before accepting it as a missing dependency. The guide identifies this risk in Autoconf, similar CMake and Meson procedures, and build tools for scripting-language C extensions; it is not confined to one configuration system. [S5]
A function call may simply lack a declaration. GCC’s guide generally recommends including the header containing the appropriate function prototype, which describes its parameter and return types. For functions inside the same project, a shared header should be included by both the callers and the file containing the definition. That lets the compiler check their agreement. Adding a prototype can expose further type errors. In rare cases, the guide warns, it can also change the application binary interface—the calling contract between compiled components—inappropriately. Fixing the diagnostic is not permission to ignore that compatibility check. [S5]
A missing declaration does not always mean a missing header. On GNU systems, the guide notes that selecting strict C11 with -std=c11 can hide POSIX and other extensions in standard headers. Its documented alternatives include -std=gnu11, or keeping -std=c11 and adding -D_DEFAULT_SOURCE to expose common extensions. Autoconf projects can use AC_USE_SYSTEM_EXTENSIONS. These are choices about which interfaces the build exposes; they do not establish that every undeclared function belongs to a system extension. [S5]
Bundled build machinery needs attention too. GCC says projects carrying copies of gnulib or autoconf-archive may need updated upstream source files. It also distinguishes old core probes from more specific checks: Autoconf has supported C99 compilers in its generic core probes since at least version 2.69, but particular functionality probes may need fixes from newer versions. Merely finding a sufficiently recent Autoconf version number does not settle whether a project’s individual checks are sound. [S5]
For sources that cannot yet be ported, the guide documents -fpermissive and individual -Wno-error options for turning the new errors back into warnings. That can restore a compilation path without correcting the code the diagnostics identify. Some build systems do not pass CFLAGS to every part of a build, so GCC says the compiler command in CC may need the option instead. A wrapper may be needed when the build system cannot handle spaces in CC. [S5]
Source documents
- GCC 14.1 Releasedhttps://gcc.gnu.org/pipermail/gcc-announce/2024/000180.html
- Porting to GCC 14 — revision 8095e54fa7c659dc5b00ddc4ff4e48a30dfaa1f2https://gcc.gnu.org/git?p=gcc-wwwdocs.git;a=blob_plain;f=htdocs/gcc-14/porting_to.html;hb=8095e54fa7c659dc5b00ddc4ff4e48a30dfaa1f2
