-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
When compiling the latest stable version (v2.6.1) using GCC 14 I am getting the following errors:
unity.c:356:16: error: comparing floating-point with ‘==’ or ‘!=’ is unsafe [-Werror=float-equal]
356 | if (number == 0.0f)
| ^~
unity.c:423:52: error: comparing floating-point with ‘==’ or ‘!=’ is unsafe [-Werror=float-equal]
423 | if ((n & 1) && (((UNITY_DOUBLE)n - number) == 0.5f))
| ^~
In master latest commit 747c2ee those are at lines 370 and 437
Lines 369 to 373 in 747c2ee
| /* handle zero, NaN, and +/- infinity */ | |
| if (number == 0.0f) | |
| { | |
| UnityPrint("0"); | |
| } |
Lines 435 to 439 in 747c2ee
| #ifndef UNITY_ROUND_TIES_AWAY_FROM_ZERO | |
| /* round to even if exactly between two integers */ | |
| if ((n & 1) && (((UNITY_DOUBLE)n - number) == 0.5f)) | |
| n--; | |
| #endif |
Metadata
Metadata
Assignees
Labels
No labels