Clang/LLVM support in Visual Studio projects
-
Hi just had some discussions. on IBMMAIN regarding the C++ code (DLL) using C++ I developed and tried porting to z/os since I need a lot of the same functionality I have been compiling on Z/OS XL C++ and I got some differences as an example
auto ret = procpointer->extsymcollector->insert({ *s, *exsympointer });
where the XL C++ compiler didnt like the '{' I was told by someone who works on the XL C++ compiler to ditch MSVC and go with CLNG/LLMV by going here Clang/LLVM support in Visual Studio projects | Microsoft Learn[^] As MSVC only goes to C++ 11 in addition I was told to ditch XL C++ and go to Open XL C++ As that goes to C++ 17 or 18 and is baseD on CLANG/LLVM
-
Hi just had some discussions. on IBMMAIN regarding the C++ code (DLL) using C++ I developed and tried porting to z/os since I need a lot of the same functionality I have been compiling on Z/OS XL C++ and I got some differences as an example
auto ret = procpointer->extsymcollector->insert({ *s, *exsympointer });
where the XL C++ compiler didnt like the '{' I was told by someone who works on the XL C++ compiler to ditch MSVC and go with CLNG/LLMV by going here Clang/LLVM support in Visual Studio projects | Microsoft Learn[^] As MSVC only goes to C++ 11 in addition I was told to ditch XL C++ and go to Open XL C++ As that goes to C++ 17 or 18 and is baseD on CLANG/LLVM
MSVC C++20 and the /std:c++20 Switch - C++ Team Blog[^]
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave Kreskowiak -
Hi just had some discussions. on IBMMAIN regarding the C++ code (DLL) using C++ I developed and tried porting to z/os since I need a lot of the same functionality I have been compiling on Z/OS XL C++ and I got some differences as an example
auto ret = procpointer->extsymcollector->insert({ *s, *exsympointer });
where the XL C++ compiler didnt like the '{' I was told by someone who works on the XL C++ compiler to ditch MSVC and go with CLNG/LLMV by going here Clang/LLVM support in Visual Studio projects | Microsoft Learn[^] As MSVC only goes to C++ 11 in addition I was told to ditch XL C++ and go to Open XL C++ As that goes to C++ 17 or 18 and is baseD on CLANG/LLVM
ForNow wrote:
As MSVC only goes to C++ 11
No, it fully supports C++20. Go to project properties pages -> General -> C++ Language Standard and select "ISO C++ 20 Standard". Now, for that particular piece of code, the "{}" is the C++ initialization syntax available since C++11. You can try replacing that with:
auto ret = procpointer->extsymcollector->insert(T(*s, *exsympointer));
where
T
is the type of object that is inserted.Mircea
-
ForNow wrote:
As MSVC only goes to C++ 11
No, it fully supports C++20. Go to project properties pages -> General -> C++ Language Standard and select "ISO C++ 20 Standard". Now, for that particular piece of code, the "{}" is the C++ initialization syntax available since C++11. You can try replacing that with:
auto ret = procpointer->extsymcollector->insert(T(*s, *exsympointer));
where
T
is the type of object that is inserted.Mircea
-
David Crayford who works on the XL C\C++ z/os compiler suggested I switch my compiler from MSVC to CLANG\LLVM for a few reason one then seems to be easier portability What’s your opinion Thanks
I'm a MSVC and Visual Studio fan. I find it a superb development environment. Compiler is just one piece of the puzzle, but you also need a good editor and a good debugger. All in all, for day to day development, I think Visual Studio is hard to beat. More than once, after developing in Visual Studio I had to port to g++ and I never had any major problems.
Mircea
-
I'm a MSVC and Visual Studio fan. I find it a superb development environment. Compiler is just one piece of the puzzle, but you also need a good editor and a good debugger. All in all, for day to day development, I think Visual Studio is hard to beat. More than once, after developing in Visual Studio I had to port to g++ and I never had any major problems.
Mircea
-
ForNow wrote:
As MSVC only goes to C++ 11
No, it fully supports C++20. Go to project properties pages -> General -> C++ Language Standard and select "ISO C++ 20 Standard". Now, for that particular piece of code, the "{}" is the C++ initialization syntax available since C++11. You can try replacing that with:
auto ret = procpointer->extsymcollector->insert(T(*s, *exsympointer));
where
T
is the type of object that is inserted.Mircea
Mircea Neacsu wrote:
No, it fully supports C++20.
Can you independently document that? Years ago (decades) there was at least one source that did a detailed comparison between compilers to see which ones were most compliant. This was after ANSI C++ was release. Microsoft did poorly in that comparison. Then someone sued to prevent such comparisons. Or perhaps added end use license terms that prevented such comparisons. If Microsoft did not start that they certainly participated in it. So my question then, as it goes back to the first one, is how do you know how compliant they are?
-
Mircea Neacsu wrote:
No, it fully supports C++20.
Can you independently document that? Years ago (decades) there was at least one source that did a detailed comparison between compilers to see which ones were most compliant. This was after ANSI C++ was release. Microsoft did poorly in that comparison. Then someone sued to prevent such comparisons. Or perhaps added end use license terms that prevented such comparisons. If Microsoft did not start that they certainly participated in it. So my question then, as it goes back to the first one, is how do you know how compliant they are?
Assuming the people behind cppreference.com are independent, and don't see any reason to suspect otherwise, this chart C++ compiler support - cppreference.com[^] shows MSVC as fully compliant.
Mircea
-
Assuming the people behind cppreference.com are independent, and don't see any reason to suspect otherwise, this chart C++ compiler support - cppreference.com[^] shows MSVC as fully compliant.
Mircea