cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

made `CppCheckExecutor::check_wrapper()` const

Open firewave opened this issue 9 months ago • 5 comments

firewave avatar Mar 23 '25 03:03 firewave

We do not detect this ourselves because of the conditional code inside.

I wonder if we could add a flag which does not omit such warnings similar to --emit-duplicates but I guess in this case it is not some global logic you could put a switch on.

firewave avatar Mar 23 '25 20:03 firewave

We do not detect this ourselves because of the conditional code inside.

This is just an assumption. I do not have actually checked this (yet).

firewave avatar Mar 28 '25 09:03 firewave

This is just an assumption. I do not have actually checked this (yet).

I confirmed that it is indeed omitted because of the preprocessor checks. But I do not see where the bailout happens in the code (I also wonder if we should write a debug message about the bailout).

firewave avatar Mar 28 '25 17:03 firewave

But I do not see where the bailout happens in the code

It is the mTokenizer->hasIfdef() call in CheckClass::checkConstFunc().

firewave avatar Mar 28 '25 18:03 firewave

It is the mTokenizer->hasIfdef() call in CheckClass::checkConstFunc().

I filed some tickets about possible improvements in the handling: https://trac.cppcheck.net/ticket/13740 https://trac.cppcheck.net/ticket/13741

firewave avatar Mar 28 '25 18:03 firewave

Superseded by #7415.

firewave avatar Jun 29 '25 16:06 firewave