Menu

Crash in cppcheck with 26ba29c30 and current head

2023-11-10
2024-01-19
  • Andrew C Aitchison

    cppcheck cppcheck.26ba29c30.test.cpp
    crashes with the attached c++ program.

    git bisect shows that f4d18a8d1 is OK but 26ba29c30 causes the crash.

     
  • Andrew C Aitchison

    Oops. A last minute change meant that the original attachment was invalid C++.
    26ba29c30.cpp compiles with g++ and clang++ but cppcheck still crashes.

     
  • CHR

    CHR - 2023-11-10

    With head I get

    foo.cpp:3:15: style: class member 'my_26ba29c30_class::i' is never used. [unusedStructMember]
        const int i = 0;
                  ^
    

    and no crash. Do you use any special flags?

     
  • Andrew C Aitchison

    No special flags.
    Turns out to be a compiler problem.

    No problem if I build with gcc13,
    but I get the crash with if I build cppcheck head with clang++ 13,14, 15, 16, 17 or 18
    (and builds with clang++ 11 and 12 fail to find system headers, probably because of software rot on my machine).

     
  • Oliver Stöneberg

    There was a change which triggered a Clang compiler bug which took a while to be worked around on our side - see https://trac.cppcheck.net/ticket/12108.

    I am curious about the Clang 11/12 build problems though. I am able to build it but I am getting a warning we cannot disable and another warning also related to that:

    warning: unknown warning option '-Wno-reserved-identifier'; did you mean '-Wno-reserved-id-macro'? [-Wunknown-warning-option]
    
    externals/picojson/picojson.h:78:9: warning: macro name is a reserved identifier [-Wreserved-id-macro]
    #define __STDC_FORMAT_MACROS
            ^
    

    What are your issues?

     

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.