K2LL33D SHELL

 Apache/2.4.7 (Ubuntu)
 Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64
 uid=33(www-data) gid=33(www-data) groups=33(www-data)
 safemode : OFF
 MySQL: ON | Perl: ON | cURL: OFF | WGet: ON
  >  / usr / src / linux-headers-3.13.0-24 / scripts / coccinelle / misc /
server ip : 104.21.89.46

your ip : 172.70.100.194

H O M E


Filename/usr/src/linux-headers-3.13.0-24/scripts/coccinelle/misc/semicolon.cocci
Size1.04 kb
Permissionrw-r--r--
Ownerroot : root
Create time27-Apr-2025 09:50
Last modified20-Jan-2014 10:40
Last accessed06-Jul-2025 15:14
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
///
/// Removes unneeded semicolon.
///
// Confidence: Moderate
// Copyright: (C) 2012 Peter Senna Tschudin, INRIA/LIP6. GPLv2.
// URL: http://coccinelle.lip6.fr/
// Comments: Some false positives on empty default cases in switch statements.
// Options: --no-includes --include-headers

virtual patch
virtual report
virtual context
virtual org

@r_default@
position p;
@@
switch (...)
{
default: ...;@p
}

@r_case@
position p;
@@
(
switch (...)
{
case ...:;@p
}
|
switch (...)
{
case ...:...
case ...:;@p
}
|
switch (...)
{
case ...:...
case ...:
case ...:;@p
}
)

@r1@
statement S;
position p1;
position p != {r_default.p, r_case.p};
identifier label;
@@
(
label:;
|
S@p1;@p
)

@script:python@
p << r1.p;
p1 << r1.p1;
@@
if p[0].line != p1[0].line_end:
cocci.include_match(False)

@depends on patch@
position r1.p;
@@
-;@p

@script:python depends on report@
p << r1.p;
@@
coccilib.report.print_report(p[0],"Unneeded semicolon")

@depends on context@
position r1.p;
@@
*;@p

@script:python depends on org@
p << r1.p;
@@
cocci.print_main("Unneeded semicolon",p)