bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] parse-datetime: use labs for long int


From: Ruediger Meier
Subject: [PATCH] parse-datetime: use labs for long int
Date: Fri, 7 Apr 2017 14:24:10 +0200

From: Ruediger Meier <address@hidden>

clang warns about this:

lib/parse-date.y:909:16: warning: absolute value function 'abs' given an
      argument of type 'long' but has parameter of type 'int' which may cause
      truncation of value [-Wabsolute-value]

Signed-off-by: Ruediger Meier <address@hidden>
---
 lib/parse-datetime.y | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/parse-datetime.y b/lib/parse-datetime.y
index 51ba4cc..b3a872b 100644
--- a/lib/parse-datetime.y
+++ b/lib/parse-datetime.y
@@ -1154,7 +1154,7 @@ time_zone_hhmm (parser_control *pc, textint s, long int 
mm)
   /* If the absolute number of minutes is larger than 24 hours,
      arrange to reject it by incrementing pc->zones_seen.  Thus,
      we allow only values in the range UTC-24:00 to UTC+24:00.  */
-  if (24 * 60 < abs (n_minutes))
+  if (24 * 60 < labs (n_minutes))
     pc->zones_seen++;
 
   return n_minutes;
-- 
1.8.5.6




reply via email to

[Prev in Thread] Current Thread [Next in Thread]