As you can see, I am specifying in the library configuration that "the_macro" has the leak-ignore flag. Is this a limitation of CppCheck, or is there some other way around this? I am aware that if I change the 3rd line to
<function name="the_function">
It will correctly report the memory leak. However, I would rather not have to do this if possible. I'm using a very large library and the user-facing side of the API documentation does not specify if something is a macro, or an actual function (assumably to keep backwards compatibility with old code, etc). Any suggestions? Or am I out of luck? Thanks.
Edit: I'm using 1.70 Win7
Last edit: Justin Dailey 2015-09-22
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As you probably know.. the preprocessor just replaces the_macro with the the_function and there is no way to know what the original name was. So imho there is nothing we can do after the preprocessor.
I assume the macro is in a header file. Do you get some problems if you remove the -I ?
Last edit: Daniel Marjamäki 2015-09-23
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes that macro is in a header file. If I remove the include for that directory, then CppCheck does not report as many errors, warnings, etc since there are alot of other normal macros and function declarations in those header files.
Thanks for the help anyways.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to get this to report a memory leak...
Given:
As you can see, I am specifying in the library configuration that "the_macro" has the leak-ignore flag. Is this a limitation of CppCheck, or is there some other way around this? I am aware that if I change the 3rd line to
It will correctly report the memory leak. However, I would rather not have to do this if possible. I'm using a very large library and the user-facing side of the API documentation does not specify if something is a macro, or an actual function (assumably to keep backwards compatibility with old code, etc). Any suggestions? Or am I out of luck? Thanks.
Edit: I'm using 1.70 Win7
Last edit: Justin Dailey 2015-09-22
I can see your problem.
As you probably know.. the preprocessor just replaces the_macro with the the_function and there is no way to know what the original name was. So imho there is nothing we can do after the preprocessor.
I assume the macro is in a header file. Do you get some problems if you remove the -I ?
Last edit: Daniel Marjamäki 2015-09-23
Yes that macro is in a header file. If I remove the include for that directory, then CppCheck does not report as many errors, warnings, etc since there are alot of other normal macros and function declarations in those header files.
Thanks for the help anyways.