and for a file suppression this doesn't make sense as you can not distinguish it from a line supression. It would be easier to remove the lineNumber so that it is similar to the global suppressions given via cli
<suppressionerrorId="variableScope"/>
For suppression blocks i am not sure how it is currently handled internally but the output in the dump file should either be
So maybe we can add the type to the Dump file to give the additional information and we don't need to remove the lineNumber for the file suppression as the type should be "file" and therefore descriptive.
I would suggest to add Type, lineBegin, lineEnd to the dump file export if they exist.
Last edit: Sven Wienand 2024-02-27
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey,
i found that if i place the
or
the dump file will have
and for a file suppression this doesn't make sense as you can not distinguish it from a line supression. It would be easier to remove the lineNumber so that it is similar to the global suppressions given via cli
For suppression blocks i am not sure how it is currently handled internally but the output in the dump file should either be
or something maybe something like
Any suggestions what should be the correct notaition in the dump file and what implication that might have? Especially regarding setting lineNumber of the global file suppression to None?
Also hints where to do the change would be appreciated. For now i found https://github.com/danmar/cppcheck/blob/da518aa92f7e40ad31625b791f9a0b1325b2c8a1/lib/suppressions.cpp#L444 and https://github.com/danmar/cppcheck/blob/da518aa92f7e40ad31625b791f9a0b1325b2c8a1/lib/suppressions.h#L140C13-L140C23, to get line Begin and End if they are filled out correctly.
The only thing i didn't found yet was where the line would be set for the cppcheck-suppress-file to set it to NO_LINE.
Last edit: Sven Wienand 2024-02-27
Okay now i found that there is a Type: https://github.com/danmar/cppcheck/blob/da518aa92f7e40ad31625b791f9a0b1325b2c8a1/lib/suppressions.h#L45-L47
So maybe we can add the type to the Dump file to give the additional information and we don't need to remove the lineNumber for the file suppression as the type should be "file" and therefore descriptive.
I would suggest to add Type, lineBegin, lineEnd to the dump file export if they exist.
Last edit: Sven Wienand 2024-02-27