I am trying to explore the possibility of extending the CPPCheck functionality for our code. Our code is in C and implements an embedded software. I actually have 2 questions:
1) I am trying to load a custom config file using the CPPCheck GUI using View -> Library Editor. My custom config file has this:
When I try loading it, I see no change in the Library Editor window. Can I trust that I have been able to load the config file? How do I load a custom configuration file via the CPPCheck GUI?
2) My goal with my custom config file is to tell CPPCheck to check the calls for mm_malloc and mm_free and identify possible memory leak. Please note that mm_malloc does not call malloc() and mm_free does not call free() function of C. Our code manages our own memory. Is it possible to make CPPCheck do that?
Last edit: Jocris Bitoon 2016-09-08
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1) In the GUI, create a project. Put the cfg file in the same folder as the cppcheck project file. Now, in the project dialog in the GUI, you should see a checkbox where you can enable the cfg file.
Hello,
I am trying to explore the possibility of extending the CPPCheck functionality for our code. Our code is in C and implements an embedded software. I actually have 2 questions:
1) I am trying to load a custom config file using the CPPCheck GUI using View -> Library Editor. My custom config file has this:
<def> <memory> <alloc>mm_malloc</alloc> <dealloc>mm_free</dealloc> </memory> </def>When I try loading it, I see no change in the Library Editor window. Can I trust that I have been able to load the config file? How do I load a custom configuration file via the CPPCheck GUI?
2) My goal with my custom config file is to tell CPPCheck to check the calls for mm_malloc and mm_free and identify possible memory leak. Please note that mm_malloc does not call malloc() and mm_free does not call free() function of C. Our code manages our own memory. Is it possible to make CPPCheck do that?
Last edit: Jocris Bitoon 2016-09-08
hello! sorry for late reply.
1) In the GUI, create a project. Put the cfg file in the same folder as the cppcheck project file. Now, in the project dialog in the GUI, you should see a checkbox where you can enable the cfg file.
2) yes your configuration should fix that.
If you put these 3 files in a empty folder:
1.cfg:
1.c:
1.cppcheck:
Then when you check "1.cppcheck" in the GUI you will see the memory leak.