Skip to content

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

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

firewave merged 1 commit into
cppcheck-opensource:mainfrom
firewave:cov-var-copy

Conversation

@firewave

@firewave firewave commented Feb 4, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

@firewave

firewave commented Feb 4, 2025 •

Copy link
Copy Markdown
Collaborator Author

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
@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