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
|
/* handle zero, NaN, and +/- infinity */ |
|
if (number == 0.0f) |
|
{ |
|
UnityPrint("0"); |
|
} |
|
#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 |
When compiling the latest stable version (v2.6.1) using GCC 14 I am getting the following errors:
In
masterlatest commit 747c2ee those are at lines 370 and 437Unity/src/unity.c
Lines 369 to 373 in 747c2ee
Unity/src/unity.c
Lines 435 to 439 in 747c2ee