[committed] c: Default to -std=gnu23
Joseph Myers
josmyers@redhat.com
Fri Nov 22 14:33:54 GMT 2024
On Fri, 22 Nov 2024, Sam James wrote:
> > Some estimate of the build failure would also be helpful. Is it the
> > same as, e.g. the GCC 12 to GCC 13 update, or is it igher?
>
> It's pretty large so far. Between 12 and 13, the main issues were:
> libstdc++ transitive include changes and a small number of -Werror
> breakages.
What's the comparison to the GCC 13-to-14 update like? It's GCC 14 that
made implicit int, implicit function declarations and some other such
things into errors by default. I think of both those things and
unprototyped function declarations (and old-style function definitions,
and defining your own bool rather than using _Bool / <stdbool.h>) as
indicative of old code that hasn't been very well maintained over the
years.
Both the GCC 14 changes and this change required large numbers of changes
to the GCC testsuite, but many of those would have been because automatic
test reduction tools are liable to reduce tests to the minimum number of
tokens accepted by the compiler, which tended to result in unprototyped
function declarations, implicit int and implicit function declarations
when the compiler accepted such things, rather than indicating that the
original code from a bug report was actually using those features before
reduction.
(When fixing the testsuite I tended to err on the side of using
-std=gnu17, not because the use of unprototyped functions was expected to
be in any way essential for most tests, but because it's harder to figure
out years later whether in fact the test cares about functions being
unprototyped or not. That is not of course the best fix for most code
outside the compiler testsuite - actually using correct prototypes would
be better for most application code that now gets errors for unprototyped
declarations.)
--
Joseph S. Myers
josmyers@redhat.com
More information about the Gcc
mailing list