diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2023-03-20 16:20:48 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2024-04-17 16:12:40 -0300 |
commit | 774dfa5a5a2631a690ddeda24f652fa849fcbc57 (patch) | |
tree | a87ef1708058b511bc4c99054550b7bcb01f65ea | |
parent | a31deccd49a258d1fa4f415ede1ea0a1ea9ddc86 (diff) | |
download | glibc-774dfa5a5a2631a690ddeda24f652fa849fcbc57.tar.gz glibc-774dfa5a5a2631a690ddeda24f652fa849fcbc57.tar.xz glibc-774dfa5a5a2631a690ddeda24f652fa849fcbc57.zip |
support: Handle clang support/dtotimespec.c on dtotimespec
clang issues: dtotimespec.c:31:25: error: implicit conversion from 'time_t' (aka 'long') to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Werror,-Wimplicit-const-int-float-conversion] else if (sec >= 1.0 + TYPE_MAXIMUM (time_t)) ~ ^~~~~~~~~~~~~~~~~~~~~ ../include/intprops.h:57:4: note: expanded from macro 'TYPE_MAXIMUM' ((t) (! TYPE_SIGNED (t) \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ So explicit cast it to double.
-rw-r--r-- | support/dtotimespec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/support/dtotimespec.c b/support/dtotimespec.c index 106b64f486..8c8eaddb51 100644 --- a/support/dtotimespec.c +++ b/support/dtotimespec.c @@ -28,7 +28,7 @@ dtotimespec (double sec) { if (sec <= TYPE_MINIMUM (time_t)) return make_timespec (TYPE_MINIMUM (time_t), 0); - else if (sec >= 1.0 + TYPE_MAXIMUM (time_t)) + else if (sec >= 1.0 + (double) TYPE_MAXIMUM (time_t)) return make_timespec (TYPE_MAXIMUM (time_t), TIMESPEC_HZ - 1); else { |