cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

cppcheckexecutor.cpp: some unique errors were suppressed

Open firewave opened this issue 3 years ago • 3 comments

The code which checks for unique error messages did not apply the template configuration which lead to suppression of unique messages:

(information) Cppcheck cannot find all the include files (use --check-config for details)
nofile:0:0: information: Cppcheck cannot find all the include files (use --check-config for details) [missingInclude]
(information) Cppcheck cannot find all the include files (use --check-config for details)
nofile:0:0: information: Cppcheck cannot find all the include files (use --check-config for details) [missingIncludeSystem]

The latter was omitted since the messages are identical.

There is possibly a different approach which would be including the ID if no template is specified. Or use the same format as when no template is specified and added the ID.

firewave avatar Aug 18 '22 11:08 firewave

it seems redundant to say "Cppcheck cannot find all the include files" twice.. so does this fix that?

danmar avatar Aug 20 '22 09:08 danmar

it seems redundant to say "Cppcheck cannot find all the include files" twice.. so does this fix that?

No it does enable that. But it is two different IDs. I wanted to change the message to say include and system include so they are actually unique so they can be distinguished when not using IDs at all.

It's also just an intermediate fix since these warnings will go away completely with #3229.

firewave avatar Aug 20 '22 15:08 firewave

Still this would cause different errors with identical messages though not be to be printed. Or it might lead actual duplicated messages being shown depending on your template - e.g. you could just output the file, line and column and would get multiple ones.

As people can write their own addons and all the message are passed through here it might even be intentional to use the same message with varying IDs though.

I wonder if the filtering should be configurable since suppression non-unique messages seems like a workaround for some kind of bug.

I am aware though that the main reason for this is to prevent duplicated messages from headers.

firewave avatar Aug 20 '22 15:08 firewave