Skip to content

fixed some Variable copied when it could be moved Coverity warnings#7278

Merged
firewave merged 1 commit intocppcheck-opensource:mainfrom
firewave:cov-var-copy
Mar 16, 2025
Merged

fixed some Variable copied when it could be moved Coverity warnings#7278
firewave merged 1 commit intocppcheck-opensource:mainfrom
firewave:cov-var-copy

Conversation

@firewave
Copy link
Copy Markdown
Collaborator

@firewave firewave commented Feb 4, 2025

No description provided.

@firewave
Copy link
Copy Markdown
Collaborator Author

firewave commented Feb 4, 2025

Coverity will now also report this findings if the variable which is being copied is const - requiring you not only to get rid of the copy but also make it mutable. This is actually an idea I also had about extending another proposed check (see https://trac.cppcheck.net/ticket/8945).

I only applied this in cases where the scope is small. It also reports this for some very big scopes but I chose not to change those. I might re-visit those if they have a measurable effect.

@firewave firewave marked this pull request as ready for review February 4, 2025 13:35
@firewave firewave merged commit de1a969 into cppcheck-opensource:main Mar 16, 2025
60 checks passed
@firewave firewave deleted the cov-var-copy branch March 16, 2025 19:51
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.

1 participant