Skip to content

fix #13961: Additional information for inline suppression in XML output#7622

Merged
danmar merged 5 commits intocppcheck-opensource:mainfrom
ludviggunne:13961
Jun 26, 2025
Merged

fix #13961: Additional information for inline suppression in XML output#7622
danmar merged 5 commits intocppcheck-opensource:mainfrom
ludviggunne:13961

Conversation

@ludviggunne
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread cli/processexecutor.cpp Outdated
Comment thread lib/suppressions.cpp
Comment thread lib/suppressions.cpp Outdated
if (extraPos != std::string::npos) {
extraComment = trim(comment.substr(extraPos + extraDelimiterSize));
for (auto it = extraComment.begin(); it != extraComment.end();)
it = *it < 0 ? extraComment.erase(it) : it + 1;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you assume that a char is signed here? that is not always true.

This comment was marked as resolved.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a feeling that we should skip more characters. all control characters to start with. but well maybe that is a question for toxml instead.. and we don't have to solve that in this PR maybe.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, the same characters need to be escaped in HTML as in XML, and toxml handles control characters, so should be good to go.

@ludviggunne ludviggunne force-pushed the 13961 branch 2 times, most recently from 70eedd1 to 71d2327 Compare June 26, 2025 07:55
@danmar danmar merged commit 542da04 into cppcheck-opensource:main Jun 26, 2025
53 checks passed
@ludviggunne ludviggunne deleted the 13961 branch June 26, 2025 10:46
winterz pushed a commit to winterz/cppcheck that referenced this pull request Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants