Server IP : 209.38.156.173 / Your IP : 216.73.216.0 [ Web Server : Apache/2.4.52 (Ubuntu) System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.1.2-1ubuntu2.22 Disable Function : NONE Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/modules/5.15.0-152-generic/build/scripts/coccinelle/misc/ |
Upload File : |
// SPDX-License-Identifier: GPL-2.0 /// Return statements in functions returning bool should use /// true/false instead of 1/0. // // Confidence: High // Options: --no-includes --include-headers virtual patch virtual report virtual context @r1 depends on patch@ identifier fn; typedef bool; symbol false; symbol true; @@ bool fn ( ... ) { <... return ( - 0 + false | - 1 + true ) ; ...> } @r2 depends on report || context@ identifier fn; position p; @@ bool fn ( ... ) { <... return ( * 0@p | * 1@p ) ; ...> } @script:python depends on report@ p << r2.p; fn << r2.fn; @@ msg = "WARNING: return of 0/1 in function '%s' with return type bool" % fn coccilib.report.print_report(p[0], msg)