]> Savannah Git Hosting - gnulib.git/commitdiff
timespec-sub: Fix compilation error on clang.
authorPip Cet <pipcet@protonmail.com>
Wed, 10 Jul 2024 15:56:34 +0000 (15:56 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 21 Jul 2024 01:12:10 +0000 (03:12 +0200)
Reported by Gerd Möllmann <gerd.moellmann@gmail.com> at
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=72036>.

* lib/timespec-sub.c (timespec_sub): Use 'int' as type of variable.
Copyright-paperwork-exempt: Yes

ChangeLog
lib/timespec-sub.c

index 29d02be97993476fa3d69ead4ee7fbe00c2231d2..e43d26a02b62befeab1c4f9501a97366c896bb8d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-07-10  Pip Cet  <pipcet@protonmail.com>
+
+       timespec-sub: Fix compilation error on clang.
+       Reported by Gerd Möllmann <gerd.moellmann@gmail.com> at
+       <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=72036>.
+       * lib/timespec-sub.c (timespec_sub): Use 'int' as type of variable.
+       Copyright-paperwork-exempt: Yes
+
 2024-07-06  Bruno Haible  <bruno@clisp.org>
 
        pthread-cond: Fix compilation error on native Windows.
index f6d948780e4dfa9cc3a6a8c0c83a13f21ff1dad5..38f9c6a4dc29c1a71d3a911c90d095fb5a60f10f 100644 (file)
@@ -31,7 +31,7 @@ struct timespec
 timespec_sub (struct timespec a, struct timespec b)
 {
   int nsdiff = a.tv_nsec - b.tv_nsec;
-  bool borrow = nsdiff < 0;
+  int borrow = nsdiff < 0;
   time_t rs;
   int rns;
   bool v = ckd_sub (&rs, a.tv_sec, b.tv_sec);