From 355784ac86d0144b641b7da34bc8ba9b08baa791 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sun, 20 Sep 2020 22:58:16 +0100 Subject: Fix 32-bit build errors --- debian/patches/32-bit-casts.patch | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 debian/patches/32-bit-casts.patch (limited to 'debian/patches/32-bit-casts.patch') diff --git a/debian/patches/32-bit-casts.patch b/debian/patches/32-bit-casts.patch new file mode 100644 index 0000000..cb11235 --- /dev/null +++ b/debian/patches/32-bit-casts.patch @@ -0,0 +1,30 @@ +From: pedro martelletto +Date: Sun, 20 Sep 2020 22:56:30 +0100 +Subject: add two casts to silence warnings on 32-bit + +add two casts to silence 'comparison is always false' warnings on +32-bit platforms (gcc: -Werror=type-limits, clang: +-Wtautological-constant-out-of-range-compare); gh#210 + +Origin: upstream, https://github.com/Yubico/libfido2/commit/7a17a4e9127fb6df6278f19396760e7d60a5862c +Bug: https://github.com/Yubico/libfido2/issues/210 +Last-Update: 2020-09-20 +--- + src/hid_linux.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/hid_linux.c b/src/hid_linux.c +index 9788012..c554784 100644 +--- a/src/hid_linux.c ++++ b/src/hid_linux.c +@@ -385,8 +385,8 @@ timespec_to_ms(const struct timespec *ts, int upper_bound) + int64_t x; + int64_t y; + +- if (ts->tv_sec < 0 || ts->tv_sec > INT64_MAX / 1000LL || +- ts->tv_nsec < 0 || ts->tv_nsec / 1000000LL > INT64_MAX) ++ if (ts->tv_sec < 0 || (uint64_t)ts->tv_sec > INT64_MAX / 1000LL || ++ ts->tv_nsec < 0 || (uint64_t)ts->tv_nsec / 1000000LL > INT64_MAX) + return (upper_bound); + + x = ts->tv_sec * 1000LL; -- cgit v1.2.3