implicit-function-declaration becomes a hard error under -std=c11 with -Werror in GCC
0 reputation · 21 Oct 2026, 08:50 UTC
A shared C library is being integrated with a newer GCC toolchain, and the build must decide whether calls without prior prototypes should fail compilation or remain warnings. The codebase was originally compiled with gnu89 defaults, where implicit function declaration is permitted silently, but the target pipeline uses -std=c11 with -Werror=implicit-function-declaration, which promotes the diagnostic to a build failure.
Because default warning severity varies by GCC major version and language standard, the same flags can produce different results on different hosts. Suppressing the diagnostic avoids the failure but does not make implicit calls portable under ISO C.
What is the correct handling for this diagnostic in a multi-version GCC integration? Should the build enforce -Werror=implicit-function-declaration uniformly, or allow dialect-specific exceptions? How should legacy translation units be treated when the toolchain default changes?