7 ms·
Specifically, in 2015 our C99 Standard Library implementation is complete, except for tgmath.h (irrelevant in C++) and the CX_LIMITED_RANGE/FP_CONTRACT pragma m
by StephanTLavavej 11y ago
Specifically, in 2015 our C99 Standard Library implementation is complete, except for tgmath.h (irrelevant in C++) and the CX_LIMITED_RANGE/FP_CONTRACT pragma macros.
- jjoonathan 11y agoBack when I first had the shock of discovering that VS only supported C89 I remember poking around to figure out why and finding a rant from a higher-up on the compiler team along the lines of "C is a dead language, just use C++." What happened? Did he leave? Did an order come down from on high? Did he mellow with age?
- Hobotron1 11y agoDoesn't the latest C++ standard more or less include C99?
- plorkyeran 11y agoOnly the C99 standard library. The language changes which weren't already part of C++ weren't imported.
- Scorponok 11y agoI believe the choice was to spend time on adding C99 support, vs spending more time on C++ support. C++ had more people asking for it, so it got priority over C99.
- spongo2 11y agoOur current statement of support is that we support enough of C99 to unblock commonly used libraries. We support a large swath of C99 but it is correct that our support isn't complete yet as we prioritized C++ conformance. If there is a C99 library that you need to use that we don't work with, please let me know. (I'm the VC++ dev manager)
- comex 11y agoIt seems that MSVC really has improved its support for C99, though, and I'm glad about that. What about C11? Does it support _Atomic/stdatomic.h? I can't tell from Googling, and I'm too tired to install the CTP tonight... If it does, it'd be ahead of OS X, hopefully not for long. The C11/C++11 memory model is powerful, way nicer to use than volatile plus OS-specific library functions, and, compared to other features, it's difficult to properly implement as a shim. It's too bad that only C++ can take advantage of it on some platforms. Existing libraries are one thing, but when writing new code (and yes, I want to write new code in C), one of the big three compilers not supporting a feature is strong motivation not to use it... even if it would be really nice to have. Maybe in the coming years Clang will improve its Windows support enough that I can just tell everyone to swap it in for cl.exe, so I won't have to care about MSVC's standards support, but for now it and GCC are missing a lot of features on Windows.
- StephanTLavavej 11y agoThe C11 Standard Library has not been incorporated into any C++ Standard (not even the C++17 Working Paper as of right now), so we have not attempted to support it. On the other hand, our C++11 <atomic> implementation has been significantly improved in VC 2015.
- pmelendez 11y agoHuh... Didn't know STL was on HN.. Good to see you here! :)
- BinaryIdiot 11y agoWhen I was 16 years old I would get into the nuwen IRC where I learned and really started my whole programming education / career through STL. I still remember the std::vector explanation that included cats in buckets. Prior to him I only opened VB's IDE and...that was it. He had me writing algorithms in C++. Too bad I'm so rusty in C++ nowadays; need to get back on it. I like using the nuwen MinGW distro when I worked on Windows; made picking up boost and SDL really simple. (Just figured I'd share since you mentioned him; he probably doesn't remember me at all but without him I don't know if I would have ever become a developer. In fact at the time I was thinking about becoming a doctor but was a lazy high schooler who dreaded the years of education required)
- StephanTLavavej 11y agoHa, that's cool to hear!
- aninteger 11y agoI haven't used Visual Studio to compile C in a long long time, but does it support compiling files as C files as well? For example: char ptr = malloc(10); // this is not valid C++ vs char ptr = (char *)malloc(10); // This is usually required for Visual C++ (or was).
- cmircea 11y agoYes, on the properties of the file you can specify whether to compile as C or C++. It can also be set as a project default. I believe files with the .c extensions are compiled as C, not C++.
- billforsternz 11y agoPlease edit to add an asterisk in front of ptr in both cases.
- awalton 11y agoIt's the markdown getting in the way. You can tell by the varying italics.
- billforsternz 11y agoIndeed. Still needs to be fixed.
- cokernel_hacker 11y agocomplex.h seems very incomplete.