https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108694
--- Comment #8 from Mark Wielaard <mark at gcc dot gnu.org> --- (In reply to Florian Weimer from comment #7) > (In reply to Mark Wielaard from comment #6) > > (In reply to Bruno Haible from comment #5) > > > Now that GCC 15 is released, with -std=gnu23 as the default, this ticket > > > is > > > no longer needed. > > > > I think it is still needed to have a way to warn about the empty argument > > list, even if this is now defined/allowed in C23. > > We have this: > > ‘-Wdeprecated-non-prototype (C and Objective-C only)’ > Warn if a function declared with an empty parameter list ‘()’ is > called with one or more arguments, or if a function definition with > one or more parameters is encountered after such a declaration. > Both cases are errors in C23 and later dialects of C. > > This warning is also enabled by ‘-Wc11-c23-compat’. But that doesn't trigger when there is an empty parameter list declared with () instead of (void). > 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.
