Dear list,
There is a patch that removes a semicolon after a switch:
http://patchwork.linuxtv.org/patch/12987/
It can be described as:
@@
@@
switch (...) { }
-;
There are 230 hits of this on recent Kernel. But I was wondering that
every semicolon after curly braces may be style error. So I'm thinking
on a semantic patch for removing semicolon after curly braces. The
semantic patch:
@@
statement S;
@@
S
-;
works but there are many false positives for empty statements like:
for (...)
; /* <-- I do not want to remove this */
How can I avoid empty statements ending on ';'? Any ideas?
My first attempt, that do not work, was:
@@
@@
{
- };
+ }
[]'s
Peter
--
Peter Senna Tschudin
[email protected]
gpg id: 48274C36
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)