I am able to disable the clang analyzer with an '#ifdef' and I was trying to put in
a line to suppress cppcheck in the macro: /* cppcheck-suppress nullPointer */
But it seems I can only disable the nullPointer warning if I put the suppress line before calling the macro.
Is it possible to tell cppcheck to skip the nullPointer check just for this macro using inline annotations? That way I only have to add the annotation once.
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It would be really nice to be able to put a suppression inside a macro. But that is not possible right now. And I have the feeling it would be a pretty complex change.
This could be solved with a -D__clang_analyzer__ on the command line. I would combine that with a --force.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the project I am using cppcheck for (CRIU) we have a macro which cppcheck does not like. The clang analyzer also complains about it:
See: https://github.com/checkpoint-restore/criu/blob/criu-dev/include/common/bug.h
I am able to disable the clang analyzer with an '#ifdef' and I was trying to put in
a line to suppress cppcheck in the macro:
/* cppcheck-suppress nullPointer */
But it seems I can only disable the nullPointer warning if I put the suppress line before calling the macro.
Is it possible to tell cppcheck to skip the nullPointer check just for this macro using inline annotations? That way I only have to add the annotation once.
Thanks
It would be really nice to be able to put a suppression inside a macro. But that is not possible right now. And I have the feeling it would be a pretty complex change.
This could be solved with a
-D__clang_analyzer__
on the command line. I would combine that with a--force
.Okay, thanks. Will try using
-D
.