Skip to content

Commit 4a16586

Browse files
committed
DeadCode: Add implementation scopes, correct docs
1 parent 0e9f1a2 commit 4a16586

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

rule_packages/c/DeadCode.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
"maintainability"
1818
],
1919
"implementation_scope": {
20-
"description": "This query reports ...",
21-
"items": []
20+
"description": "This query reports basic blocks in the program which are unreachable. For basic blocks within templates, the block is only consider unreachable if it is unreachable in all templates. Code generated by macros is ignored for this query, because it may be the case that basic blocks are reachable only in some expansions."
2221
},
2322
"shared_implementation_short_name": "UnreachableCode"
2423
}
@@ -41,6 +40,19 @@
4140
"readability",
4241
"maintainability"
4342
],
43+
"implementation_scope": {
44+
"description": "This query identifies dead statements in the program of the following kinds:",
45+
"items": [
46+
"Declarations of a non-static stack variable whose initializing expression is pure (i.e. has no side-effects) and that is never subsequently accessed in live code.",
47+
"Blocks that contain only dead statements.",
48+
"Do loops whose condition is pure, and whose body contains only dead statements.",
49+
"If statements whose condition is pure, and whose then and else clauses (where they exist) only contain dead statements.",
50+
"Label statements to which the code never jumps.",
51+
"While loops whose condition is pure, and whose body contains only dead statements.",
52+
"Expression statements whose expressions are pure.",
53+
"Writes to a non-static stack variable that is never subsequently read in live code."
54+
]
55+
},
4456
"shared_implementation_short_name": "DeadCode"
4557
}
4658
],

0 commit comments

Comments
 (0)