Skip to content

Taking care of operation overloading functions#958

Closed
Hinterwaeldlers wants to merge 1 commit intodanmar:masterfrom
Hinterwaeldlers:overloadOperator
Closed

Taking care of operation overloading functions#958
Hinterwaeldlers wants to merge 1 commit intodanmar:masterfrom
Hinterwaeldlers:overloadOperator

Conversation

@Hinterwaeldlers
Copy link
Copy Markdown
Contributor

When an operation is overloaded, the related function was incorrectly marked as unused. This fix the related false positive and append related tests

@danmar
Copy link
Copy Markdown
Owner

danmar commented Sep 8, 2017

Please remove the <regex> include. We only require partial handling of C++11.

@Hinterwaeldlers
Copy link
Copy Markdown
Contributor Author

ups thx. will remove it

@amai2012
Copy link
Copy Markdown
Collaborator

Compatibility with VS10 was violated, see https://ci.appveyor.com/project/danmar/cppcheck/build/1.73.4338/job/rp3u52i8bkwof3ra
Maybe changing that single line (replacing auto ) may cure this w/o major efforts?!

// Deallocation variants; space is delete within the simplification
"delete", "delete[]"
};
for (auto const & curOp : knownOperators) {
Copy link
Copy Markdown
Owner

@danmar danmar Oct 19, 2017

Choose a reason for hiding this comment

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

please don't use a ranged for loop. That is C++11. It seems clumpsy to check for every known operator. If opName is any operator (!std::isalnum(opName[0] && opName[0] != '_')) then I think this function could return true.

@danmar
Copy link
Copy Markdown
Owner

danmar commented Nov 3, 2017

I close this pull request because there are unhandled review comments. I think only minor tweaks are needed. Feel free to reopen if you fix the review comments.

@danmar danmar closed this Nov 3, 2017
francois-berder added a commit to francois-berder/cppcheck that referenced this pull request Apr 7, 2026
Using while(!feof(fp)) is a common C bug: feof() only returns true
after a read has already failed, causing the loop body to execute
once more after the last successful read. Read errors also go
undetected since feof() does not distinguish them from EOF.

Signed-off-by: Francois Berder <fberder@outlook.fr>
francois-berder added a commit to francois-berder/cppcheck that referenced this pull request Apr 7, 2026
feof() only returns true after a read has already failed, causing
the loop body to execute once more after the last successful read.
Read errors also go undetected since feof() does not distinguish
them from EOF.

Signed-off-by: Francois Berder <fberder@outlook.fr>
francois-berder added a commit to francois-berder/cppcheck that referenced this pull request Apr 7, 2026
francois-berder added a commit to francois-berder/cppcheck that referenced this pull request Apr 8, 2026
francois-berder added a commit to francois-berder/cppcheck that referenced this pull request Apr 12, 2026
francois-berder added a commit to francois-berder/cppcheck that referenced this pull request Apr 12, 2026
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.

3 participants