Hello,
There is this external header-only library that our codebase depends on, and I include the path to it as part of -I flag. When disable checking headers, my understanding is cppcheck will still go into these headers but remove the definition, leaving only declaration behind. When I chose this option, cppcheck crashes and after debugging for a while, I found out I got assert(brackets.empty() == false) here: https://github.com/danmar/cppcheck/blob/main/lib/templatesimplifier.cpp#L2220.
I didn't get this issue when enabling checking headers, so seems like simplifyHeadersAndUnusedTemplates might work incorrectly. Is there a way to output such redacted file to help investigate more? I know there's --dump and --debug option, but they only output full header files. FYI I'm using cppcheck version 2.9
Thanks a lot!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks, that's what I've been doing as well. I know which header and which line it occurs now, but when I bring that file out and test it, I couldn't reproduce the crash...
I'll continue digging around then...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
There is this external header-only library that our codebase depends on, and I include the path to it as part of -I flag. When disable checking headers, my understanding is cppcheck will still go into these headers but remove the definition, leaving only declaration behind. When I chose this option, cppcheck crashes and after debugging for a while, I found out I got assert(brackets.empty() == false) here: https://github.com/danmar/cppcheck/blob/main/lib/templatesimplifier.cpp#L2220.
I didn't get this issue when enabling checking headers, so seems like simplifyHeadersAndUnusedTemplates might work incorrectly. Is there a way to output such redacted file to help investigate more? I know there's --dump and --debug option, but they only output full header files. FYI I'm using cppcheck version 2.9
Thanks a lot!
Maybe you could reduce the input code to a minimal reproducer? Looking at the token's line number in the debugger when it hits the assert might help.
Thanks, that's what I've been doing as well. I know which header and which line it occurs now, but when I bring that file out and test it, I couldn't reproduce the crash...
I'll continue digging around then...