Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Clang/LLVM support in Visual Studio projects

Clang/LLVM support in Visual Studio projects

Scheduled Pinned Locked Moved C / C++ / MFC
c++visual-studiocsharpcomtutorial
9 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    ForNow
    wrote on last edited by
    #1

    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

    D M 2 Replies Last reply
    0
    • F ForNow

      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

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • F ForNow

        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

        M Offline
        M Offline
        Mircea Neacsu
        wrote on last edited by
        #3

        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

        F J 2 Replies Last reply
        0
        • M Mircea Neacsu

          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

          F Offline
          F Offline
          ForNow
          wrote on last edited by
          #4

          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

          M 1 Reply Last reply
          0
          • F ForNow

            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

            M Offline
            M Offline
            Mircea Neacsu
            wrote on last edited by
            #5

            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

            F 1 Reply Last reply
            0
            • M Mircea Neacsu

              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

              F Offline
              F Offline
              ForNow
              wrote on last edited by
              #6

              thank you

              1 Reply Last reply
              0
              • M Mircea Neacsu

                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

                J Offline
                J Offline
                jschell
                wrote on last edited by
                #7

                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?

                M 1 Reply Last reply
                0
                • J jschell

                  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?

                  M Offline
                  M Offline
                  Mircea Neacsu
                  wrote on last edited by
                  #8

                  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

                  J 1 Reply Last reply
                  0
                  • M Mircea Neacsu

                    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

                    J Offline
                    J Offline
                    jschell
                    wrote on last edited by
                    #9

                    Well that is nice.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups