4 ms·
This presents c89 as the most antiquated thing in the world, but VS didn't support mixed declarations and code in a .c file until 2015. There is still a lot of
by asveikau 7y ago
This presents c89 as the most antiquated thing in the world, but VS didn't support mixed declarations and code in a .c file until 2015. There is still a lot of code out there that avoids this to be able to work with MS's compilers.
- deleted 7y ago[deleted]
- ygra 7y ago... in C mode, which is basically C89 (+ whatever is needed for recent C++ versions). Compiling C code in C++ mode is a common way of working around this. But MSVC is not a C compiler, it's a C++ compiler, so their unwillingness to invest in C is probably understandable.
- barrkel 7y agoCould have done it with C++, would have worked for calling WinAPI too.
- asveikau 7y agoIf there are gripes about c89 I don't want to think about how different c++ support would be relative to the late 90s or early to mid 2000s, let alone now.
- cesarb 7y agoIt's now 2019, and as far as I know, MSVC still doesn't have full support for the 20-year-old C99 standard.
- asveikau 7y agoShortly after my comment I remembered that even in c99 or c++, there are patterns where mixed declaration and code are messy. WndProc switch statements is one example. You can't jump past a declaration of the same scope, so a case label can't declare anything unless you add curly braces.