On Wed, 16 Oct 2024, Eric Gallager via Gcc wrote:

> One thing about -Wtraditional is that it enables a lot of different
> messages, so I always thought it would make more sense as an umbrella
> warning that just enables a bunch of sub-warning flags. While many of
> the individual sub-warnings may no longer be relevant, some of them
> might still be useful for reasons besides compatibility with
> traditional C.

A few are also controlled by other options (I'm not proposing doing 
anything with -Wtraditional-conversion or -Wlong-long, for example).  I 
don't think any of the others are likely to be of use.

"non-static declaration of %q+D follows static declaration"
"traditional C lacks a separate namespace for labels, identifier %qE conflicts"
"traditional C rejects ISO C style function definitions"
"traditional C rejects string constant concatenation"
"traditional C rejects the unary plus operator"
"traditional C rejects automatic aggregate initialization"
"traditional C rejects initialization of unions"
"%<long%> switch expression not converted to %<int%> in ISO C"
"the meaning of %<\\%c%> is different in traditional C"
"the meaning of %<\\x%> is different in traditional C"
"the meaning of %<\\a%> is different in traditional C"
"suggest not using %<#elif%> in traditional C"
"traditional C ignores %<#%s%> with the %<#%> indented"
"suggest hiding %<#%s%> from traditional C with an indented %<#%>"
"traditional C rejects the %<%.*s%> suffix"
"function-like macro %qs must be used with arguments in traditional C"
"macro argument %qs would be stringified in traditional C"

If someone thinks one of these is desirable as a coding style warning 
without regard for traditional C, please explain why.  Or if you do have 
code you'd like to build with both GCC 15 or later, and a pre-C89 
compiler, please give details.  Such details are much more relevant than 
pure speculation that maybe something could be of use to someone.

-- 
Joseph S. Myers
josmy...@redhat.com

Reply via email to