3 ms·
The obvious diagnostic would be "if auto and < C23, emit warning". That can definitely be implemented. Choosing the name would take longer than writing the code
by JonChesterfield 3y ago
The obvious diagnostic would be "if auto and < C23, emit warning". That can definitely be implemented. Choosing the name would take longer than writing the code.
Lots of stuff is valid and gets warnings on request, like `if (a = b)`, or anything where people get precedence or aliasing rules often enough that someone bothered to patch the compiler.
- quelsolaar 3y agoThat is if you know about this issue. Very few people do. At some point C23 may become a default version of C in some compilers and someone who has been building code without specifying what version of C they use, will silently get a bug. That is the problem. There is no way for a C compiler to look at the code and determine what version it was written for.
- uecker 3y agoImplicit int was removed in C99. Since then most compilers warn about this in default compilation mode.