Menu

cppcheck won't build with new gcc-13 nor clang++ 16.0.2

dcb
2023-05-10
2023-05-11
  • CHR

    CHR - 2023-05-10

    If someone would finish this PR... https://github.com/danmar/cppcheck/pull/5015/

     
  • dcb

    dcb - 2023-05-10

    Thanks for the information.

    Given that cppcheck has to compile with a variety of C++ compilers, I'd be tempted to rework the cppcheck code into something most C++ compilers can easily accept.

    Writing bleeding edge C++ code that some compilers have trouble implementing is IMHO asking for trouble.

     
    • Daniel Marjamäki

      Given that cppcheck has to compile with a variety of C++ compilers, I'd be tempted to rework the cppcheck code into something most C++ compilers can easily accept.

      As far as I know that is our approach. Do you see some bleeding edge C++ code?

      According to the PR the problem is the opposite.. bleeding edge libraries require some attribute that we don't have?

       
  • dcb

    dcb - 2023-05-11

    Do you see some bleeding edge C++ code?

    Yes, use of lambdas. They have only been around since C++11 and have been enhanced
    ever since (C++14, C++17). That's probably ok if cppcheck only had to work with one compiler.

    I'd be interested to find out which C++ compiler accepts the current cppcheck code.
    MS maybe ?

     
    • Daniel Marjamäki

      We do require some C++11 features. I do not think there is C++14 or later features. You can compile cppcheck source code with g++ 4.8 so the problem is not that we are too bleeding edge.

       
      • Daniel Marjamäki

        C++11 lambdas is something we do require.

         
  • dcb

    dcb - 2023-05-11

    Two workarounds:

    1. The static assert went into gcc trunk on 2022-12-14, so use a compiler from before then.
      20221204 seems to work.

    2. More brutally, remove the static assert from the alloc_traits.h header file.
      This will affect other builds.

     
  • dcb

    dcb - 2023-05-11

    apply the changes in PR 5015?

    Yes and the changes make it work for both gcc and clang. Thanks very much !

    Some warnings were produced, I will make those the subject of another thread.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.