A smarter diagnostic, especially for (inline) function definitions, would be to see if it features a K&R parameter list; if it does, error (because K&R is not supported). If it's just a naked declaration with whatever meow();, error. But definition with no K&R? Fine.
Conversation
Notices
-
Embed this notice
ThePhD (thephd@pony.social)'s status on Monday, 24-Mar-2025 23:56:16 JST ThePhD
- Haelwenn /элвэн/ :triskell: likes this.
-
Embed this notice
ThePhD (thephd@pony.social)'s status on Monday, 24-Mar-2025 23:56:17 JST ThePhD
Now that I've had time to experience it:
diagnosing int main() {} as a "K&R prototype" is a bit too aggressive on Clang's end. I would understand diagnosing simply a declaration of int main();, but diagnosing a full definition that has no parameters and also features no K&R-style definition parameter list is diabolical work, lol.