We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fbc7c89 commit 8072b53Copy full SHA for 8072b53
c/cert/test/rules/FLP34-C/test.c
@@ -1,8 +1,8 @@
1
-#include <stddef.h>
2
-#include <stdint.h>
+#include <float.h>
3
#include <limits.h>
4
#include <math.h>
5
-#include <float.h>
+#include <stddef.h>
+#include <stdint.h>
6
7
void test_no_guard(float f) {
8
int i = f; // NON_COMPLIANT
@@ -28,11 +28,10 @@ size_t popcount(uintmax_t num) {
28
#define PRECISION(umax_value) popcount(umax_value)
29
30
void test_precision_check(float f) {
31
- if (isnan(f) ||
32
- PRECISION(INT_MAX) < log2f(fabsf(f)) ||
+ if (isnan(f) || PRECISION(INT_MAX) < log2f(fabsf(f)) ||
33
(f != 0.0F && fabsf(f) < FLT_MIN)) {
34
/* Handle error */
35
} else {
36
- int i= f; // COMPLIANT
+ int i = f; // COMPLIANT
37
}
38
0 commit comments