4 ms·
Hopefully it will be added to the standard C library so it will be everywhere - eg Microsoft, Apple, etc.
by ape4 12y ago
Hopefully it will be added to the standard C library so it will be everywhere - eg Microsoft, Apple, etc.
- Danieru 12y agoThat would occur in something C11+, but Microsoft has yet to implement even C99.
- pjmlp 12y agoThey haven been very clear about this, from Herb Sutter's blog, Connect message postings and presentations at BUILD. Somehow, the message seems to keep getting lost. Visual C++ is a C++ compiler, that is the language that is relevant to keep supporting for systems programming in Windows. Time to move forward. As of Windows 8 it is now possible to use C++ in DDK and kernel team is making the code compile C++ compatible. C89 support is good enough for backwards compatibility and what has been added from C99 was what is required from the C++11 standard.
- stephencanon 12y agoIf only C++ were actually "forward" from C, it would be reasonable to tell people to move forward.
- pjmlp 12y agoI have been on the C++ camp since 1993, after having to deal with C for one year, and a couple of Turbo Pascal years behind me. C was already feeling primitive in 1993 when compared with languages like Turbo Pascal and C++ offered so much more in terms of type safety and modular programming. So yes, it has been forward from C since a few decades already.
- wahern 12y agoActually, about 6 months ago Microsoft did an about face. They're now approaching near complete C99 support, adding features deliberately rejected by C++, such as designated initializers and compound literals. In fact, compound literal syntax is probably incompatible with C++, because similar syntax in C++ requires entirely different object lifetimes--expression scope in C++, block scope in C99. Actually, I think the target may be C11, as I doubt they'll add VLAs.
- dottrap 12y agoIs this really true? Last I saw, they were adding some the of C99 features (because the C++11/14 spec actually required some of it), but not going all the way. And it was unclear if they were only focusing on the language or the standard library or both. (I'm willing to skip C99 for C11 because am sick of dancing around Visual Studio for compatibility. Clang for Visual Studio is looking really appealing to me.) Why they have the only world's C++ compiler that can't handle C baffles me. What did they screw up so badly in their implementation that every other C/C++ compiler got right?
- pjmlp 12y ago> Why they have the only world's C++ compiler that can't handle C baffles me. Why? C++ was born at AT&T, the same place C was born. Given its design to be as compatible with C as possible, it was quite natural for C compiler vendors to bundle a C++ compiler with their C compiler. There isn't any requirement in ANSI/ISO C++ that a C++ compiler vendor is obliged to support C. Microsoft's decision is not technical, but political. From their point of view, if you want to write C style code, there isn't nothing in C++ that prevents it. On the other hand, C cannot provide at the language level the mechanisms available in C++ to write safe code. Not to mention that Windows APIs are mostly COM based since the Windows XP, anyway. If you want C on Windows, or to have fun using COM or WinRT from C, there are plenty of other compilers available. Both Symbian and BeOS were C++ based OS. I for one, enjoy seeing Windows going into the same direction.
- wahern 12y agoSee my post down thread. Or just read these pages http://msdn.microsoft.com/en-us/library/hh409293.aspx http://msdn.microsoft.com/en-us/library/hh409293.aspx http://blogs.msdn.com/b/vcblog/archive/2013/07/19/c99-library-support-in-visual-studio-2013.aspx http://blogs.msdn.com/b/vcblog/archive/2013/07/19/c99-librar... http://blogs.msdn.com/b/vcblog/archive/2014/06/03/visual-studio-14-ctp.aspx http://blogs.msdn.com/b/vcblog/archive/2014/06/03/visual-stu...
- pjmlp 12y ago> They're now approaching near complete C99 support, adding features deliberately rejected by C++, such as designated initializers and compound literals. No they did not. Herb Sutter was very explicit about this. - C99 language features as required by the C++11/14 standards - compound literal syntax just to allow certain well known open source project to be ported to Windows, mainly game related projects Nothing else is planned as shown on his slides. http://channel9.msdn.com/Events/Visual-Studio/Launch-2013/VS112 http://channel9.msdn.com/Events/Visual-Studio/Launch-2013/VS... Edit: Added link to Visual Studio 2013 launch presentation from Herb Sutter.
- marssaxman 12y agoPerhaps the message keeps getting lost because it is a bad message. They have made the wrong decision, to such a degree that people have a hard time understanding just how wrong their decision is, and keep naively assuming that this is some kind of schedule/resource failure and not a decision to do the wrong thing.
- pjmlp 12y agoExcept many of us on the C++ side think of it as a good decision. But as someone pointed out to me, things seem to have changed a bit more than I thought.
- ksherlock 12y agoOS X inherited it from FreeBSD. VC++ is a c++ compiler and any c support is incidental. I suspect this won't be included in c++17.
- _delirium 12y agoC11 added a different set of safe string functions, although as an optional standard annex (Annex K). They have _s suffixes, e.g. strcpy_s(), and somewhat different behavior. It seems unlikely that ISO would also add strlcpy() at this point, given that one set of "safe" functions is already (sort of) in the standard. But maybe POSIX could standardize it.
- yuhong 12y agoWhich came directly from MS.
- BudVVeezer 12y agoExcept that it was a collaborative effort that involved far more than just Microsoft, such as CERT, and the WG14 committee as a whole...
- dottrap 12y agoToo bad Microsoft Visual Studio refuses to get with the times and update their antiquated compiler from C89. They are now 2 standards and 25 years behind.
- ygra 12y agoVS has a C++ compiler, not a C compiler. There is no getting with the times. That's like advocating that the Java compiler should get with the times and start compiling C++11. C and C++ are quite different languages, despite looking superficially the same. Think of it as a DVCS history that evolved into two very different branches at one point (C89) with the occasional feature branch of C merged into C++.
- deleted 12y ago[deleted]
- dottrap 12y agoVisual Studio is the only major C++ compiler that is inept at handling C. This is not unreasonable to expect proper C support and there is something terribly broken with Visual Studio in that they can't. Even Stroustrup has called for better compatibility with C.
- cpeterso 12y agoMicrosoft has its own (ugly) safe string APIs like StringCchCatEx(): http://msdn.microsoft.com/en-us/library/ms647466.aspx http://msdn.microsoft.com/en-us/library/ms647466.aspx http://msdn.microsoft.com/en-us/library/td1esda9.aspx http://msdn.microsoft.com/en-us/library/td1esda9.aspx