Activity for cppcheck

  • Daniel Marjamäki Daniel Marjamäki posted a comment on discussion Development

    I would like to start preparations for the Cppcheck-2.20 release. The handling of Polyspace suppressions is needed in a customer trial. I suggest that we focus more on fixing bugs and testing in the coming weeks. Avoid adding complex features.

  • john borland john borland posted a comment on discussion Development

    I often use Flame Graphsto track down performance issues. It has been some time since I have profiled cppcheck. Last time I looked at it some of the valueflow functions could escalate run time. I wasn't smart enough to figure out any useful ways of dealing with it back then. On linux there is a tool called perf top I can often use to get I high level view for performance offenders. Then there is GDB if I really need to break in to see if a program is stuck.

  • CHR CHR posted a comment on discussion Development

    There are lots of if conditions in that file. cppcheck is known to have performance issues on such code, see e.g. https://trac.cppcheck.net/ticket/11262 So it's probably not a real hang that you are seeing, but an extremely long execution time.

  • Guy Maurel Guy Maurel posted a comment on discussion Development

    Hello! I am the maintainer of https://github.com/uncrustify/uncrustify I try to use cppcheck with our sources. At least one source file produces a "infinite loop" : https://github.com/uncrustify/uncrustify/src/indent.cpp What shall I do to find out where is the bug? Which tools may I use for that. Thanks for any hint guy

  • graham.reeds graham.reeds modified a comment on discussion General Discussion

    In my CMake file I download 2.19 and build it. However there are errors in compilation. The first states: C:\dev\repos\MyApp\build_deps\cppcheck-src\lib\cppcheck.cpp(880,36): error C2440: '<function-style-cast>': cannot convert from 'initializer list' to 'simplecpp::Toke nList' [C:\dev\repos\MyApp\build_deps\cppcheck-build\lib\cppcheck-core.vcxproj]</function-style-cast> That line is return simplecpp::TokenList{data, size, files, file.spath(), outputList}; Looking in tokenlist.h I can see there is...

  • graham.reeds graham.reeds modified a comment on discussion General Discussion

    In my CMake file I download 2.19 and build it. However there are errors in compilation. The first states: C:\dev\repos\MyApp\build_deps\cppcheck-src\lib\cppcheck.cpp(880,36): error C2440: '<function-style-cast>': cannot convert from 'initializer list' to 'simplecpp::Toke nList' [C:\dev\repos\MyApp\build_deps\cppcheck-build\lib\cppcheck-core.vcxproj]</function-style-cast> That line is return simplecpp::TokenList{data, size, files, file.spath(), outputList}; Looking in tokenlist.h I can see there is...

  • graham.reeds graham.reeds posted a comment on discussion General Discussion

    In my CMake file I download 2.19 and build it. However there are errors in compilation. The first states: C:\dev\repos\MyApp\build_deps\cppcheck-src\lib\cppcheck.cpp(880,36): error C2440: '<function-style-cast>': cannot convert from 'initializer list' to 'simplecpp::Toke nList' [C:\dev\repos\MyApp\build_deps\cppcheck-build\lib\cppcheck-core.vcxproj]</function-style-cast> That line is return simplecpp::TokenList{data, size, files, file.spath(), outputList}; Looking in tokenlist.h I can see there is...

  • vix vix posted a comment on discussion General Discussion

    cppcheck signals the warning Parameter 'callbackData' can be declared as pointer to const when the implementation of the fuction allows the const-qualification of the parameter. This is right. Sometimes the signature of the function is imposed by something else. As an example it's the callback of something and the parameter callbackData is not const in the required signature. Is there a way for me to mark in the soruce code that the cppcheck warning should be skipped for this parameter?

  • DougCube DougCube modified a comment on discussion General Discussion

    This seems to be a false positive: (using 2.19.0) vector<int> vec; ... for(auto it = vec.begin(); it != vec.end();) { ... do { ... if(++it == vec.end()) break; } while(*it == 123); ... } warning: Either the condition 'it!=prev.end()' is redundant or there is possible dereference of an invalid iterator: it. [derefInvalidIteratorRedundantCheck] } while(it == 123); ^note: Assuming that condition 'it!=prev.end()' is not redundant for(auto it = vec.begin(); it != vec.end();) { ^note: Dereference of an...

  • Marcus Gigandet Marcus Gigandet modified a comment on discussion General Discussion

    Ignore this post. Accidental duplicate

  • CHR CHR posted a comment on discussion General Discussion

    Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/14443

  • DougCube DougCube posted a comment on discussion General Discussion

    This seems to be a false positive: (using 2.19.0) vector<int> vec; ... for(auto it = vec.begin(); it != vec.end();) { ... do { ... if(++it == vec.end()) break; } while(*it == 123); ... } warning: Either the condition 'it!=prev.end()' is redundant or there is possible dereference of an invalid iterator: it. [derefInvalidIteratorRedundantCheck] } while(it == 123); ^note: Assuming that condition 'it!=prev.end()' is not redundant for(auto it = vec.begin(); it != vec.end();) { ^note: Dereference of an...

  • DougCube DougCube posted a comment on discussion General Discussion

    I switched to version 2.19.0 and this issue is fixed.

  • DougCube DougCube posted a comment on discussion General Discussion

    It looks like I was running a much older version (v2.13.0 from 2023) because that is what Ubuntu apt install gives currently. But I have now manually installed v2.19.0 and this issue is fixed.

  • DougCube DougCube modified a comment on discussion General Discussion

    I think this is a false positive. template <typename T> constexpr T func(const T n) { if constexpr(std::is_signed_v<T>) if(n < 0) throw out_of_range(" n < 0 not allowed!"); ... } style: Checking if unsigned expression 'n' is less than zero. [unsignedLessThanZero] if(n < 0) throw out_of_range("n < 0 not allowed!"); -Doug

  • DougCube DougCube posted a comment on discussion General Discussion

    2.13.0

  • DougCube DougCube modified a comment on discussion General Discussion

    I think this is a false positive. class Foo { static constexpr size_t DEPTH = 4; std::array<T, DEPTH+1> arr; [[noreturn]] my_exit() { exit(1); } public: const T* func(const unsigned int n) const { if(n > DEPTH) my_exit(); return &arr[n]; } } warning: Either the condition 'n>DEPTH' is redundant or 'n' can have the value 4. Expression 'arr[n]' cause access out of bounds. [containerOutOfBounds] return &arr[n]; ^ There might also be a typo in the error message as here the array index can range from 0...

  • Marcus Gigandet Marcus Gigandet posted a comment on discussion General Discussion

    Hello, I've just upgrade a codebase using cppcheck 2.10 to 2.17.1 and then 2.19.1 and have run into an error that I haven't be able to solve, but I have identified the root cause. Consider the following code: typedef struct MyStruct { float thing; } MyStruct_t; static MyStruct_t myArray[sizeof(MyStruct_t)]; When evaluated on version 2.17.1 or higher (tested 2.17.1, 2.19, 2.19.1), it gives the following error: src\demo.c:6:26: error: Because of missing configuration, misra checking is incomplete....

  • Marcus Gigandet Marcus Gigandet posted a comment on discussion General Discussion

    Hello, I've just upgraded a codebase using cppcheck 2.10 to 2.17.1 and then 2.19.1 and have run into an error that I haven't be able to solve, but I have identified the root cause. Consider the following code: typedef struct MyStruct { float thing; } MyStruct_t; static MyStruct_t myArray[sizeof(MyStruct_t)]; When evaluated on version 2.17.1 or higher (tested 2.17.1, 2.19, 2.19.1), it gives the following error: src\demo.c:6:26: error: Because of missing configuration, misra checking is incomplete....

  • CHR CHR posted a comment on discussion General Discussion

    I can't reproduce this, which version are you using? Also, please add ~~~ around code.

  • CHR CHR posted a comment on discussion General Discussion

    Should be covered by https://trac.cppcheck.net/ticket/12387

  • CHR CHR posted a comment on discussion General Discussion

    Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/14431

  • Adel Mamin Adel Mamin posted a comment on discussion General Discussion

    > cppcheck --version Cppcheck 2.18.3 File test.c: struct foo { int foo; }; struct bar { struct foo foo; }; struct baz { struct bar bar; }; int main(void) { struct baz baz = {.bar = {.foo = {.foo = 1}}}; return 0; } The error: > cppcheck test.c Checking test.c ... test.c:14:34: error: Expression '.foo={.foo=1}' depends on order of evaluation of side effects [unknownEvaluationOrder] struct baz baz = {.bar = {.foo = {.foo = 1}}}; ^

  • DougCube DougCube posted a comment on discussion General Discussion

    I think this is a false positive. class Foo { static constexpr size_t DEPTH = 4; std::array<t, depth+1=""> arr;</t,> [[noreturn]] my_exit() { exit(1); } public: const T* func(const unsigned int n) const { if(n > DEPTH) my_exit(); return &arr[n]; } } warning: Either the condition 'n>DEPTH' is redundant or 'n' can have the value 4. Expression 'arr[n]' cause access out of bounds. [containerOutOfBounds] return &arr[n]; ^ There might also be a typo in the error message as here the array index can range...

  • DougCube DougCube posted a comment on discussion General Discussion

    I think this is a false positive. template <typename t=""> constexpr T func(const T n) { if constexpr(std::is_signed_v<t>) if(n < 0) throw out_of_range(" n < 0 not allowed!"); ... }</t></typename> style: Checking if unsigned expression 'n' is less than zero. [unsignedLessThanZero] if(n < 0) throw out_of_range("n < 0 not allowed!"); -Doug

  • wy163 wy163 modified a comment on discussion General Discussion

    Hi, I think this may be a bug. For example, with the command "cppcheck --project=/path/compile_commands.json -I /include_path main.c", the include_path will not take effect.

  • wy163 wy163 modified a comment on discussion General Discussion

    Hi, I think this may be a bug. For example, with the command "cppcheck --project=/path/compile_commands.json -I /include_path", the include_path will not take effect.

  • wy163 wy163 modified a comment on discussion General Discussion

    Hi, I think this may be a bug. For example, with the command: cppcheck --project=/path/compile_commands.json" -I "/include_path", the include_path will not take effect.

  • wy163 wy163 posted a comment on discussion General Discussion

    Hi, I think this may be a bug. For example, with the command "cppcheck --project=/path/compile_commands.json" -I "/include_path", the include_path will not take effect.

  • Andrew C Aitchison Andrew C Aitchison modified a comment on discussion General Discussion

    I assume that you are using a Cppcheck build folder: option --cppcheck-build-dir=... This wont speed up analysis of individual files, but will avoid having to re-analyze files that have not changed. This option does not seem to be in man cppcheckbut is mentioned in cppcheck --help and in manual.pdf chapter 3.

  • Andrew C Aitchison Andrew C Aitchison posted a comment on discussion General Discussion

    I assume that you are using a Cppcheck build folder: option --cppcheck-build-dir=... This wont speed up analysis of individual files, but will avoid having to re-analyze files that have not changed. This option does not seem to be in man cppcheckbut is mentioned in cppcheck --help and in manual.pdf chapter 3.

  • wy163 wy163 modified a comment on discussion General Discussion

    Hi, In the file cppcheck/lib/cppcheck.cpp: unsigned int CppCheck::check(const FileSettings &fs) { // TODO: move to constructor when CppCheck no longer owns the settings if (mSettings.checks.isEnabled(Checks::unusedFunction) && !mUnusedFunctionsCheck) mUnusedFunctionsCheck.reset(new CheckUnusedFunctions()); Settings tempSettings = mSettings; // this is a copy if (!tempSettings.userDefines.empty()) tempSettings.userDefines += ';'; if (mSettings.clang) tempSettings.userDefines += fs.defines; else tempSettings.userDefines...

  • wy163 wy163 posted a comment on discussion General Discussion

    Hi, In the file cppcheck/lib/cppcheck.cpp: unsigned int CppCheck::check(const FileSettings &fs) { // TODO: move to constructor when CppCheck no longer owns the settings if (mSettings.checks.isEnabled(Checks::unusedFunction) && !mUnusedFunctionsCheck) mUnusedFunctionsCheck.reset(new CheckUnusedFunctions()); Settings tempSettings = mSettings; // this is a copy if (!tempSettings.userDefines.empty()) tempSettings.userDefines += ';'; if (mSettings.clang) tempSettings.userDefines += fs.defines; else tempSettings.userDefines...

  • CHR CHR posted a comment on discussion General Discussion

    Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/14404

  • wy163 wy163 posted a comment on discussion General Discussion

    Hi, void main() { int max_v = INT_MAX; int x = max_v + 1; max_v += 1; } There is an integerOverflow reported for "x = max_v + 1". But it is not reported for "max_v += 1".

  • Jeroen Pouwels Jeroen Pouwels posted a comment on discussion General Discussion

    Oh, mea culpa. I now see that also an old version of cppcheck is in the path on my machine (it is part of Strawberry Perl....), which is the one being started. My apologies...

  • CHR CHR posted a comment on discussion General Discussion

    I just installed 2.19 and cppcheck runs fine. How/where did you install cppcheck? Are the .cfg files in %ProgramFiles%\cppcheck\cfg present and accessible?

  • Jeroen Pouwels Jeroen Pouwels modified a comment on discussion General Discussion

    Starting cppcheck 2.19 from the provided Windows installer with date 2025-12-21 gives the following error: cppcheck: Failed to load library configuration file 'std.cfg'. File not found Failed to load std.cfg. Your Cppcheck installation is broken, please re-install. The Cppcheck binary was compiled with FILESDIR set to "R:/winlibs64ucrt_stage/inst_cppcheck-2.14.0/share/Cppcheck" and will therefore search for std.cfg in R:/winlibs64ucrt_stage/inst_cppcheck-2.14.0/share/Cppcheck/cfg. Please provide...

  • Jeroen Pouwels Jeroen Pouwels posted a comment on discussion General Discussion

    Starting cppcheck 2.19 from the provided Windows installer with date 2025-12-21 gives the following error: cppcheck: Failed to load library configuration file 'std.cfg'. File not found Failed to load std.cfg. Your Cppcheck installation is broken, please re-install. The Cppcheck binary was compiled with FILESDIR set to "R:/winlibs64ucrt_stage/inst_cppcheck-2.14.0/share/Cppcheck" and will therefore search for std.cfg in R:/winlibs64ucrt_stage/inst_cppcheck-2.14.0/share/Cppcheck/cfg. Please provide...

  • vix vix posted a comment on discussion General Discussion

    I tested the nightly build and I confirm that the fix works perfectly. Thanks one more time.

  • CHR CHR posted a comment on discussion Development

    Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/14399

  • penguish penguish posted a comment on discussion Development

    example: #include <stdexcept> #include <cstdio> void testit (bool throw_p){ if (throw_p) throw std::runtime_error("test"); } void test1(){ std::puts("test1"); { testit(false); } try { testit(true); } catch (const std::runtime_error& e){ std::puts("caught exception:"); std::puts(e.what()); } } int main(){ test1(); return 0; } the code runs and produces output: test1 caught exception: test i.e. the exception is caught inside the test function as it should be. However, cppcheck 2.19.1 reports: athena/test.cxx:23:3:...

  • Andrew C Aitchison Andrew C Aitchison posted a comment on discussion General Discussion

    https://cppcheck.sourceforge.io/manual.pdf chapter 17 (library-configuration) has some general advice about speeding up analysis. Another option, which would be a non-trivial amount of work and I am only guessing that this would ultimately be faster than cppcheck reading the header, is to write a custom .cfg library for this header. "You can use the Library Editor in the Cppcheck GUI to edit configuration files. It is available in the View menu." See manual.pdf chapter 14, and https://cppcheck.sourceforge.io/reference-cfg-format.pdf...

  • wy163 wy163 posted a comment on discussion General Discussion

    Hi, For example, I have below code in main.c: #include <stdlib.h> int main() { return 0; } With "cppcheck main.c -I /usr/include", there will be error: error: failed to evaluate #if condition, undefined function-like macro invocation: __GLIBC_USE( ... ) [syntaxError] #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT) The checking process will be stopped by this error, and cppcheck exit. Is this normal? As you know, there also might be -I options in the commands of a compile_commands.json. So...

  • Jonathan Forrest Jonathan Forrest posted a comment on discussion General Discussion

    I currently have some very simple c files in an embedded project that are taking ~25 seconds to run cppcheck so I started digging into why this is. From --showtime it is apparent that the misra addon is taking the majority of the time. I have managed to work out that it is happening to any file that is directly or indirectly including one particular header file. That header file is a 17000 line header file from ST micro that contains all of the data structures and address mapping for the microcontroller...

  • Kamen Kitanov Kamen Kitanov modified a comment on discussion General Discussion

    This is reproduced on Windows with cppcheck 2.19.0 D:\a.cpp: #line 1 "D:/sub/a.cpp" // This includes D:/sub/a instead of D:/a.h. #include "a.h" D:\sub\a.h: #error "This file should not be included" Output: Checking a.cpp ... D:\sub\a.h:1:2: error: #error "This file should not be included" [preprocessorErrorDirective] #error "This file should not be included" If you use a relative path for #line instead, it looks like the working directory of cppcheck and the relative path in the line directive will...

  • Kamen Kitanov Kamen Kitanov modified a comment on discussion General Discussion

    This is reproduced on Windows with cppcheck 2.19.0 D:\a.cpp: // #line 1 "D:/sub/a.cpp" // This includes D:/sub_folder/a instead of D:/a.h. #include "a.h" D:\sub\a.h: #error "This file should not be included" Output: Checking a.cpp ... D:\sub\a.h:1:2: error: #error "This file should not be included" [preprocessorErrorDirective] #error "This file should not be included" If you use a relative path for #line instead, it looks like the working directory of cppcheck and the relative path in the line directive...

  • Kamen Kitanov Kamen Kitanov posted a comment on discussion General Discussion

    This is reproduced on Windows with cppcheck 2.19.0 D:\a.cpp: // #line 1 "D:/sub/a.cpp" // This includes D:/sub_folder/a instead of D:/a.h. #include "a.h" D:\sub\a.h: #error "This file should not be included" If you use a relative path for #line instead, it looks like the working directory of cppcheck and the relative path in the line directive will affect the include path for the file. Expected behaviour: The #line directive should not affect the include path - it should only change the reported...

  • vix vix posted a comment on discussion General Discussion

    thanks!

  • CHR CHR posted a comment on discussion General Discussion

    The fix is in: https://github.com/danmar/cppcheck/pull/8112

  • vix vix posted a comment on discussion General Discussion

    Thanks. I use the above prototype in most of my source files. So, at the moment, I cannot use anymore cppcheck to analyze the codebase, since these files are skipped. Is there ay temporary workaround (waiting for the fix)?

  • Jonathan Forrest Jonathan Forrest modified a comment on discussion General Discussion

    misra-c2012-7.3 seems to have a few issues.... My one is that if I have a struct with an element ending in l then when I initialise that struct it throws a warning: { .port = eGpioConfigPortA, .pin = 1U, .speed = eGpioConfigDriveLow, .pull = eGpioConfigPullUp, .output_type = eGpioConfigOutputPushPull, .alternate_function = 8U, }, Throws: config.c:129:18: style: The lowercase character "l" shall not be used in a literal suffix [misra-c2012-7.3] .pull = eGpioConfigPullUp, ^ Figured I would just add...

  • Jonathan Forrest Jonathan Forrest posted a comment on discussion General Discussion

    misra-c2012-7.3 seems to have a few issues.... My one is that if I have a struct with an element ending in l then when I initialise that struct it throws a warning: { .port = eGpioConfigPortA, .pin = 1U, .speed = eGpioConfigDriveLow, .pull = eGpioConfigPullUp, .output_type = eGpioConfigOutputPushPull, .alternate_function = 8U, }, Throws: config.c:129:18: style: The lowercase character "l" shall not be used in a literal suffix [misra-c2012-7.3] .pull = eGpioConfigPullUp, ^ Figured I would just add...

  • vix vix posted a comment on discussion General Discussion

    should I provide any additional info on this error?

  • CHR CHR posted a comment on discussion General Discussion

    Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/14387

  • vix vix modified a comment on discussion General Discussion

    Yes. This is the source code of a file named main.c typedef void (*const enableCtrls_t)(int panel_hndl); typedef struct { char uir_file[100]; int uir_panel_id; int slide; const char* title; enableCtrls_t enableCtrls; } SlideInterface; typedef const SlideInterface* (*const slideInterfaceGetter_t)(void); slideInterfaceGetter_t getSlideInterface(int current_panel) { return NULL; }

  • vix vix posted a comment on discussion General Discussion

    Yes. How can I upload files here? Or I can paste here the content of the two files

  • CHR CHR posted a comment on discussion General Discussion

    is this expected? Hard to say. Have you been able to reduce the code that generates the error?

  • vix vix posted a comment on discussion General Discussion

    I tried to do it and I noticed that analyzing one .c file only I see with -E that the same included files are listed twice: * first time with macro MY_MACRO defined * second time with macro MY_MACRO undefined is this expected?

  • CHR CHR posted a comment on discussion General Discussion

    Yeah, I have reduced the code a bit. The issue also exists in C++.

  • Daniel Daniel posted a comment on discussion General Discussion

    Thank you. btw, the typedef keyword is missing from the code in the ticket.

  • cola cola posted a comment on discussion General Discussion

    long al = 1L; // warns long fl = 1L; // warns long gl = 1L; // ok! long abcdefl = 1L; // warn long abcdefgl = 1L; // ok!

  • CHR CHR posted a comment on discussion General Discussion

    Thans for reporting, ticket is here: https://trac.cppcheck.net/ticket/14371

  • Daniel Daniel posted a comment on discussion General Discussion

    I have a lot of redundantAssignment false positives with unions. Unions are used heavily in our embedded system code. Below is an example. typedef union fixed32_union { struct { uint32_t abcd; } u32; struct { uint16_t ab; uint16_t cd; } u16; } fixed32; void func(void) { fixed32 m; m.u32.abcd = 1234; m.u32.abcd = 5 * m.u16.ab; // redundantAssignment false positive }

  • CHR CHR posted a comment on discussion General Discussion

    Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/14369

  • Frank Winklmeier Frank Winklmeier posted a comment on discussion General Discussion

    Not sure if this is tracked already somewhere: struct Foo { void bar() {} }; int main() { bool b = true; Foo* f = b ? new Foo() : nullptr; if (b) f->bar(); } > cppcheck --version Cppcheck 2.19.0 > cppcheck test.cxx Checking test.cxx ... test.cxx:8:10: warning: Possible null pointer dereference: f [nullPointer] if (b) f->bar(); ^ test.cxx:7:14: note: Assignment 'f=b?new Foo():nullptr', assigned value is 0 Foo* f = b ? new Foo() : nullptr; ^ test.cxx:8:10: note: Null pointer dereference if (b) f->bar();...

  • Daniel Daniel posted a comment on discussion General Discussion

    Is there a way to specify to cppcheck the size of enums in c code? I have projects with the equivalent of -fshort-enums enabled. Places where enumerations are converted to integer values are showing cppcheck errors. Cppcheck thinks the enumerations are 4 bytes but really the compiler makes them one byte.

  • CHR CHR posted a comment on discussion General Discussion

    Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/14368

  • vix vix posted a comment on discussion General Discussion

    I run cppcheck 2.19 from the GUI on Windows and I created a project file (*.cppcheck). I enabled Addons >> Coding standards >> MISRA C 2012 ... The file with MISRA rules starts in this way: Appendix A Summary of guidelines Rule 1.1 Required Any implementation-defined behaviour on which the output of the program depends shall be documented and understood ------------------------------------------------------------------------------- Rule 2.1 Required All source files shall compile without any compilation...

  • Frank Winklmeier Frank Winklmeier posted a comment on discussion General Discussion

    With cppcheck 2.19.0, I see the following regression: void f1(Foo* foo) { double d = 0; if (d!=-99. and foo->func() < 10 ) {} } test.cxx:3:19: error: Syntax Error: AST broken, 'foo' doesn't have a parent. [internalAstError] if (d!=-99. and foo->func() < 10 ) {} ^ Change the 99. to 99 or 99.0 or and to && and the error goes away.

  • Tobias Markus Tobias Markus posted a comment on discussion General Discussion

    Thank you! That worked fine :)

  • Tobias Markus Tobias Markus posted a comment on discussion General Discussion

    I just noticed that the above mentioned command line options --include-file and --includes-file are not mentioned in the PDF manual. I used cppcheck --help to find out about their existence. I feel like they should be added to the manual. Thanks in advance!

  • Christoph Christoph posted a comment on discussion General Discussion

    Hello, I tried to update openSuse's cppcheck package to version 2.19. RPM lint complains that cppcheck.x86_64: E: binary-or-shlib-defines-rpath (Badness: 10000) /usr/bin/cppcheck (RUNPATH: /home/abuild/rpmbuild/BUILD/cppcheck-2.19.0-build/cppcheck-2.19.0/build/lib:) cppcheck-gui.x86_64: E: binary-or-shlib-defines-rpath (Badness: 10000) /usr/bin/cppcheck-gui (RUNPATH: /home/abuild/rpmbuild/BUILD/cppcheck-2.19.0-build/cppcheck-2.19.0/build/lib:) The binary or shared library defines RPATH' (orRUNPATH')...

  • CHR CHR posted a comment on discussion Development

    Unfortunately we haven't been able to test 32-bit builds in our CI for a while now. Those tests indeed fail on a 32-bit platform.

  • Moritz Haase Moritz Haase posted a comment on discussion Development

    Hi, I'm observing three different test failures while trying to upgrade Alpine Linux's cppcheck package from 2.18.3 to 2.19.0. Only the 32-bit platforms (x86, armv7, armhf) are affected. test/testcondition.cpp:2638(TestCondition::oppositeInnerConditionEmpty) test/test64bit.cpp:107(Test64BitPortability::functionpar) test/test64bit.cpp:258(Test64BitPortability::returnIssues) Full output of the failing assertions is: [...]/cppcheck/src/cppcheck-2.19.0/test/testcondition.cpp:2638(TestCondition::oppositeInnerConditionEmpty):...

  • F. Cenedese F. Cenedese posted a comment on discussion General Discussion

    On 22 Dec 2025 10:23, Tobias Markus wrote: Hello, ever since SuperTux switched over to using cppcheck 2.19, we're getting a bunch of unknown macro errors for SDL_VERSION_ATLEAST in our code. An example being: |src/control/ game_controller_manager.cpp:312:2:error:failedtoevaluate#ifcondition,undefinedfunction-likemacroinvocation:SDL_VERSION_ATLEAST(...)[syntaxError] #ifSDL_VERSION_ATLEAST(2,0,9) | Now, we're trying to suppress them. Unfortunately, the syntaxError category is a little too broad, so...

  • Jam Bon Jam Bon posted a comment on discussion General Discussion

    Hard to say on the results, I compared some metrics from both runs: Source tree: File size: 123MB ~25min Total errors: 219938 cstyleCast: 135350 knownConditionTrueFalse: 3159 nullPointerOutOfMemory: 8344 Compilation database: File size: 23MB ~3h Total errors: 37862 cstyleCast: 15363 knownConditionTrueFalse: 349 nullPointerOutOfMemory: 5796 For the same file, the source tree based run is reporting errors but nothing in the compilation database based one (and the file is in the database of course)....

  • Tobias Markus Tobias Markus posted a comment on discussion General Discussion

    Hello, ever since SuperTux switched over to using cppcheck 2.19, we're getting a bunch of unknown macro errors for SDL_VERSION_ATLEAST in our code. An example being: src/control/game_controller_manager.cpp:312:2: error: failed to evaluate #if condition, undefined function-like macro invocation: SDL_VERSION_ATLEAST( ... ) [syntaxError] #if SDL_VERSION_ATLEAST(2, 0, 9) Now, we're trying to suppress them. Unfortunately, the syntaxError category is a little too broad, so I feel uncomfortable just adding...

  • Daniel Marjamäki Daniel Marjamäki created a blog post

    Cppcheck-2.19.0

  • cppcheck cppcheck released /cppcheck/2.19/README.md

  • cppcheck cppcheck released /cppcheck/2.19/cppcheck-2.19.0-x64-Setup.msi

  • cppcheck cppcheck updated /cppcheck/2.19/cppcheck-2.19.0.zip

  • cppcheck cppcheck updated /cppcheck/2.19/cppcheck-2.19.0.tar.bz2

  • cppcheck cppcheck updated /cppcheck/2.19/cppcheck-2.19.0.tar.gz

  • cppcheck cppcheck updated /cppcheck/2.19/cppcheck-2.19.0.zip

  • cppcheck cppcheck updated /cppcheck/2.19/cppcheck-2.19.0.tar.gz

  • cppcheck cppcheck updated /cppcheck/2.19/cppcheck-2.19.0.tar.bz2

  • cppcheck cppcheck released /cppcheck/2.19/cppcheck-2.19.0.tar.bz2

  • cppcheck cppcheck released /cppcheck/2.19/cppcheck-2.19.0.tar.gz

  • cppcheck cppcheck released /cppcheck/2.19/cppcheck-2.19.0.zip

  • Daniel Marjamäki Daniel Marjamäki posted a comment on discussion Development

    I am releasing cppcheck-2.19.0 if there will be some more fixes that should be released we can release 2.19.1

  • Daniel Marjamäki Daniel Marjamäki posted a comment on discussion General Discussion

    cppcheck.xml: 123MB It's not obvious that this is better. Are the results good?

  • Daniel Marjamäki Daniel Marjamäki modified a comment on discussion General Discussion

    It's quite usual that the compilation database will be slower, as all the include paths are provided all the headers will be included in the analysis. Sometimes it's better to provide the paths and sometimes it's better to provide compilation database (if missing macros cause problems for instance). I don't know what is better for you but I like that you try out both approaches..

  • Daniel Marjamäki Daniel Marjamäki posted a comment on discussion General Discussion

    It's quite usual that the compilation database will be slower, as all the include paths are provided all the headers will be included in the analysis. Sometimes it's better to provide the paths and sometimes it's better to provide compilation database (if missing macros cause problems for instance).

  • Jam Bon Jam Bon modified a comment on discussion General Discussion

    I am trying to find the best way to analyze my project with cppcheck. $ cppcheck --version Cppcheck 2.17.1 I was benchmarking the same cppcheck command targeting: - the root of the project source tree (.) - a compilation database generated from the project source tree (--project=compile_commands.json) with otherwise the same command line: cppcheck \ --cppcheck-build-dir=cppcheck-cache \ -j 24 \ --xml \ --xml-version=2 \ --output-file=cppcheck.xml \ --enable=all \ --force \ --check-level=exhaustive...

  • Jam Bon Jam Bon posted a comment on discussion General Discussion

    I am trying to find the best way to analyze my project with cppcheck. I was benchmarking the same cppcheck command targeting: - the root of the project source tree (.) - a compilation database generated from the project source tree (--project=compile_commands.json) with otherwise the same command line: cppcheck \ --cppcheck-build-dir=cppcheck-cache \ -j 24 \ --xml \ --xml-version=2 \ --output-file=cppcheck.xml \ --enable=all \ --force \ --check-level=exhaustive --checkers-report=cppcheck.checkers-report.txt...

  • Daniel Marjamäki Daniel Marjamäki posted a comment on discussion Development

    I would prefer it not be reverted but if it has to be reverted, I would like all other cmake changes put on pause until it gets merged in with a priority that it will be merged in the next release as I dont want to have to maintain a fork of cppcheck. that sounds reasonable to me.

  • Paul Fultz Paul Fultz posted a comment on discussion Development

    In my opinion it can be reverted there was suggestion about reimplementing the goodies in smaller PRs. It cannot be done in smaller PRs, and a new PR will probably be larger in order to address the other issues. I do have follow-up PRs to address the other issues but I am blocked right now as cppcheck wont build and I have PR to fix it which hasn't been merged: https://github.com/danmar/cppcheck/pull/8015(I think this is a must for any release) I would prefer it not be reverted but if it has to be...

  • Daniel Marjamäki Daniel Marjamäki posted a comment on discussion Development

    No idea where we are at in terms of the CMake stuff. I don't actually understand the details of the changes nor your objections. But I think your objections was ignored too quickly when you were not able to participate. There was a sense of urgency as there is a lot of flux and therefore hard to keep the PR up-to-date. In my opinion it can be reverted there was suggestion about reimplementing the goodies in smaller PRs.

  • Oliver Stöneberg Oliver Stöneberg posted a comment on discussion Development

    It is finally ready (CI still in progress though). Here's the PRs (in order): https://github.com/danmar/simplecpp/pull/606 https://github.com/danmar/simplecpp/pull/599 https://github.com/danmar/cppcheck/pull/8000 https://github.com/danmar/cppcheck/pull/7962 No idea where we are at in terms of the CMake stuff.

1 >