sqc 0.4.13

Software Code Quality - CERT C compliance checker
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*
 * Rule: EXP00-C
 * Source: testcases
 * Status: FAIL - Ambiguous operator precedence without parentheses
 */

/* Bitwise AND mixed with comparison */
int ambiguous_bitwise(int a, int b) {
    return a & b == 0;
}

/* Shift mixed with addition */
int ambiguous_shift(int a, int b) {
    return a << 2 + b;
}