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
16
/*
 * Rule: FLP01-C
 * Source: wiki
 * Status: PASS - Conservative stub rule (CERT "unenforceable"), never flags
 */

#include <math.h>

float compute(float x, float y, float z) {
    /* These rearrangements may affect precision but are not
       detectable by automated analysis per CERT guidance */
    float result = x * y * z;
    result = (x - y) + y;
    result = x + x * y;
    return result;
}