It's not very straightforward to fix this unfortunately. The suppressions are extracted from the "raw tokens" as far as I remember and that contains all code, even code that is defined out. Well maybe we can add a pass after preprocessing that removes inline suppressions that don't "have code".
If you have time to look at this.. feel free to submit a PR at github.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I get unmatched suppression warnings by cppcheck 1.90 on inline suppressions in disabled code.
For example:
With enabled code:
That was to be expected.
But if I disable the code, I get this warning:
Is this behaviour intended?
Last edit: Dennis Mierke 2020-03-08
It is not intended. There is a ticket: https://trac.cppcheck.net/ticket/5704
It's not very straightforward to fix this unfortunately. The suppressions are extracted from the "raw tokens" as far as I remember and that contains all code, even code that is defined out. Well maybe we can add a pass after preprocessing that removes inline suppressions that don't "have code".
If you have time to look at this.. feel free to submit a PR at github.