Xi Ruoyao <xry111@xxxxxxxxxxx> writes: > On Fri, 2023-06-02 at 20:52 +0200, Arsen Arsenović via Gcc-help wrote: >> I was referring to -Werror=implicit-function-declaration, >> -Werror=implicit-int, -Werror=incompatible-function-pointer-types, and >> -Werror=strict-prototypes, which don't share the usual problems of >> -Werror (by being explicit, not something that's likely to change, and >> reasonable practice IMO :-) ). > > -Werror=strict-prototypes is too strict IMO. It will even break: > > int test() { return 0; } Indeed, but I tend not to mind this in my code (falling into the latter clause in parentheses above). > But the entire point of the C2X change about the prototype w/o a > parameter list is to make such thing reasonable, isn't it? > > I guess we actually want a new warning option, like: > > extern int f(); // ok > int g() { return f(); } // ok > int h() { return f(1, 2); } // { dg-warning "the usage of non-strict prototype will be rejected by C2x" } There might be relevant discussion on https://gcc.gnu.org/PR108694. -- Arsen Arsenović
Attachment:
signature.asc
Description: PGP signature