On Wed, Oct 16, 2024 at 7:14 PM Joseph Myers via Gcc <[email protected]> wrote:
>
> One issue that showed up as test failures with a default of -std=gnu23 is
> that -std=gnu23 -Wtraditional produces a "traditional C rejects ISO C
> style function definitions" warning for function definitions with empty
> parentheses, as they are treated like (void) in C23, so resulting in
> failure of several -Wtraditional tests.
>
> Clearly that's a bug (that warning should only be given for literal
> (void), not for () meaning (void)) and wouldn't be hard to fix. But is
> there actually any current use for the -Wtraditional option? It seems
> extremely unlikely now that compatibility with pre-C89 compilers would be
> relevant. So maybe it would make more sense to remove -Wtraditional
> support (remove all the logic implementing the option, make it an option
> marked with Ignore in c.opt to do nothing so as not to break any build
> systems that hardcode this option) rather than fixing this bug with an
> option that's probably no longer useful.
I wonder if we should diagnose(?) and/or ignore -Wtraditional when
-std={c,gnu}89
isn't in effect. It doesn't make much sense to allow and not diagnose
c99+ features
but complain about oddball compatibility issues with pre-ISO C.
Richard.
> --
> Joseph S. Myers
> [email protected]
>