https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108694

--- Comment #9 from Florian Weimer <fw at gcc dot gnu.org> ---
(In reply to Mark Wielaard from comment #8)
> > I don't think it's good use of developer time to change () to (void) where
> > this is possible, so I believe this warning is sufficient.
> 
> I think it is wasting developer time to not warn about this (even in C23
> mode) since now if you are using -Werror=strict-prototypes and/or
> -Werror=old-style-definition (as is encouraged for supporting "Modern C")
> then using () instead of (void) happens to "work" under GCC15 but not
> before. So now when using GCC15 you have to remember to always also compile
> using -std=gnu11 or -std=gnu17 to make your code base builds when a user
> uses a slightly older GCC that doesn't default to C23.

If we have documentation suggesting to use those options in the Fedora context
or elsewhere, we should fix them. These options just aren't that useful, and I
don't think it's appropriate to guide developers in this direction. Even
warning about old-style function definitions by default in GCC 15 is a bit
dubious.

We got lucky and there is no conflict between old-style definitions and unnamed
function parameters. I don't think old-style function definitions are
particular bug-prone after requiring type declarations for all parameters. So
there is no fundamental reason to rewrite existing code to avoid them.

Reply via email to