Details
-
Type:
New Feature
-
Status: Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: Rules to specify, Subject: Symbolic execution, Importance: Relevant, Level: Medium
-
Component/s: C, C++, Objective-C, Rules, Symbolic Execution
-
Labels:
Description
A stronger version of S5277: if a function return value was assigned to a variable, that variable must be used later on.
Detect whether the return value reaches some "sink" - assigned to a member, global, or static variable; returned from a function, stored to a reference or pointer, affected the control flow.
Do not report cases of a function return value ignored from the beginning (e.g., set.insert( x );. Report cases when the value is assigned to a variable, and that variable then has no effect on the further execution.
Also, see S6007 as another heuristic for a function which value should not be discarded.
Attachments
Issue Links
- relates to
-
CPP-2979 S5277: This rule should also trigger on other functions whose value should not be discarded
-
- Open
-