diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2018-12-28 09:49:01 -0500 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-01-05 19:46:51 -0500 |
commit | dc7884f34a5da79c61a9443c465a99512dc7bb15 (patch) | |
tree | 7383b3dc08116199a253c6f5bfda4a83ebd69d7f /scripts/coccinelle | |
parent | a5003571e627789d8104ebdbe3ae24be41ea071a (diff) |
scripts: coccinelle: check for redeclaration
Avoid reporting on the use of an iterator index variable when
the variable is redeclared.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts/coccinelle')
-rw-r--r-- | scripts/coccinelle/iterators/use_after_iter.cocci | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/coccinelle/iterators/use_after_iter.cocci b/scripts/coccinelle/iterators/use_after_iter.cocci index ce8cc9c006e5..66a1140474c8 100644 --- a/scripts/coccinelle/iterators/use_after_iter.cocci +++ b/scripts/coccinelle/iterators/use_after_iter.cocci | |||
@@ -35,6 +35,7 @@ iterator name hlist_for_each_entry_from; | |||
35 | iterator name hlist_for_each_entry_safe; | 35 | iterator name hlist_for_each_entry_safe; |
36 | statement S; | 36 | statement S; |
37 | position p1,p2; | 37 | position p1,p2; |
38 | type T; | ||
38 | @@ | 39 | @@ |
39 | 40 | ||
40 | ( | 41 | ( |
@@ -125,6 +126,8 @@ sizeof(<+...c...+>) | |||
125 | | | 126 | | |
126 | &c->member | 127 | &c->member |
127 | | | 128 | | |
129 | T c; | ||
130 | | | ||
128 | c = E | 131 | c = E |
129 | | | 132 | | |
130 | *c@p2 | 133 | *c@p2 |