Hi,
I've starting to use coccinelle to submit some trivial cleanup patches for the
Linux kernel, and now I'm trying to write a "delete unneede braces" for
single-statement if/else branches.
I've tried this approach (the most naive possible, I fear :):
-------8<----------
@@
expression E;
statement S1,S2;
@@
- if (E) {
if (E)
S1
- } else {
+ else
S2
-}
-------8<----------
But it doesn't work, I get a lot of errors when parsing the .cocci file itself:
warning: iso neg_if does not match the code below on line 6
if (E) {
if (E) S1
}else {
>>> else
S2
}
he following code matched is not uniformly minus or context,
or contains a disjunction:
Stm:
if (E) {
if (E) S1
}else {
>>> else
S2
}
....
and so on...
I just can't figure out what the problem is here or what I'm doing wrong. Could
you please give me a hand? I'm using the standard spatch shipped with the
lattest Debian Squeeze (testing): 0.2.3.
Thanks in advance,
--
L. Alberto Giménez
JabberID [email protected]
GnuPG key ID 0x3BAABDE1
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)