chiark / gitweb /
parse-util: fix conversion from size_t on s390 (#3147)
authorLubomir Rintel <lkundrak@v3.sk>
Fri, 29 Apr 2016 09:45:07 +0000 (11:45 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 16 Jun 2017 08:12:58 +0000 (10:12 +0200)
On s390 size_t is an unsigned long, nor an unsigned int. They both are
of the same size and can be cast to each other safely, but the compiler
still seems unhappy about incompatible pointers.

Fixes: 7c2da2ca8
src/basic/parse-util.h

index 9b1aebdb51d50da661a2c75c618196a3816a25a3..ea70c5e1e6d28d589eac2be28819afdf0c6832f7 100644 (file)
@@ -96,7 +96,7 @@ static inline int safe_atoli(const char *s, long int *ret_u) {
 #if SIZE_MAX == UINT_MAX
 static inline int safe_atozu(const char *s, size_t *ret_u) {
         assert_cc(sizeof(size_t) == sizeof(unsigned));
-        return safe_atou(s, ret_u);
+        return safe_atou(s, (unsigned *) ret_u);
 }
 #else
 static inline int safe_atozu(const char *s, size_t *ret_u) {