News for hackers. Stuff that matters.
Re:Visual C++ Cross-Platform Mobile by myko on Friday April 24, 2015 @12:13PM (#9434273)
Does VS support C99 yet? While we're making requests I'd like that to get on the list.
Re:Visual C++ Cross-Platform Mobile by plorkyeran on Friday April 24, 2015 @12:30PM (#9434379)
Yes, 2013 added support for most of it and 2015 adds a few more things.
Re:Visual C++ Cross-Platform Mobile by StephanTLavavej on Friday April 24, 2015 @12:50PM (#9434483)
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.
Re:Visual C++ Cross-Platform Mobile by pmelendez on Friday April 24, 2015 @01:27PM (#9434750)
Huh... Didn't know STL was on HN.. Good to see you here! :)
Re:Visual C++ Cross-Platform Mobile by BinaryIdiot on Friday April 24, 2015 @02:40PM (#9435254)
When 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)

Re:Visual C++ Cross-Platform Mobile by StephanTLavavej on Friday April 24, 2015 @03:57PM (#9435672)
Ha, that's cool to hear!
Re:Visual C++ Cross-Platform Mobile by jjoonathan on Friday April 24, 2015 @12:59PM (#9434548)
Back 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?
Re:Visual C++ Cross-Platform Mobile by spongo2 on Friday April 24, 2015 @08:23PM (#9436657)
Our 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)
Re:Visual C++ Cross-Platform Mobile by comex on Saturday April 25, 2015 @02:55AM (#9437512)
It 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.

Re:Visual C++ Cross-Platform Mobile by StephanTLavavej on Saturday April 25, 2015 @02:03PM (#9439040)
The 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.
Re:Visual C++ Cross-Platform Mobile by Scorponok on Friday April 24, 2015 @05:43PM (#9436182)
I 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.
Re:Visual C++ Cross-Platform Mobile by Hobotron1 on Friday April 24, 2015 @02:17PM (#9435089)
Doesn't the latest C++ standard more or less include C99?
Re:Visual C++ Cross-Platform Mobile by plorkyeran on Friday April 24, 2015 @03:48PM (#9435627)
Only the C99 standard library. The language changes which weren't already part of C++ weren't imported.
Re:Visual C++ Cross-Platform Mobile by aninteger on Friday April 24, 2015 @02:22PM (#9435128)
I 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).

Re:Visual C++ Cross-Platform Mobile by cmircea on Friday April 24, 2015 @02:49PM (#9435306)
Yes, 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++.

Re:Visual C++ Cross-Platform Mobile by billforsternz on Friday April 24, 2015 @07:26PM (#9436512)
Please edit to add an asterisk in front of ptr in both cases.
Re:Visual C++ Cross-Platform Mobile by awalton on Friday April 24, 2015 @09:05PM (#9436758)
It's the markdown getting in the way. You can tell by the varying italics.
Re:Visual C++ Cross-Platform Mobile by billforsternz on Friday April 24, 2015 @11:50PM (#9437130)
Indeed. Still needs to be fixed.
Re:Visual C++ Cross-Platform Mobile by cokernel_hacker on Friday April 24, 2015 @03:22PM (#9435492)
complex.h seems very incomplete.
Re:Visual C++ Cross-Platform Mobile by DominikD on Friday April 24, 2015 @03:30PM (#9435551)
It does if you compile with Clang - VS is just a front-end after all. If you're asking about MSVC however, it's incomplete.