summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Fleury <emmanuel.fleury@u-bordeaux.fr>2019-02-04 16:36:11 +0100
committerEmmanuel Fleury <emmanuel.fleury@u-bordeaux.fr>2019-03-17 19:05:34 +0100
commit5dd02cc6f518555d1402ad06f99be784dd907899 (patch)
tree0c573109348280c5fd1f6e02ae7d0a367910d06d
parentc3d0440aa209ae588b2c771363ca62d10535eb88 (diff)
downloadglib-5dd02cc6f518555d1402ad06f99be784dd907899.tar.gz
Fixing signedness in glib/gthread-posix.c
In file included from glib/glibconfig.h:9, from glib/gtypes.h:32, from glib/gatomic.h:27, from glib/gthread.h:32, from glib/gthread-posix.c:42: glib/gthread-posix.c: In function ‘g_system_thread_new’: glib/gmacros.h:348:26: error: comparison of integer expressions of different signedness: ‘long int’ and ‘gulong’ {aka ‘long unsigned int’} [-Werror=sign-compare] #define MAX(a, b) (((a) > (b)) ? (a) : (b)) ^ glib/gthread-posix.c:1169:22: note: in expansion of macro ‘MAX’ stack_size = MAX (min_stack_size, stack_size); ^~~ glib/gmacros.h:348:35: error: operand of ?: changes signedness from ‘long int’ to ‘gulong’ {aka ‘long unsigned int’} due to unsignedness of other operand [-Werror=sign-compare] #define MAX(a, b) (((a) > (b)) ? (a) : (b)) ^~~ glib/gthread-posix.c:1169:22: note: in expansion of macro ‘MAX’ stack_size = MAX (min_stack_size, stack_size); ^~~
-rw-r--r--glib/gthread-posix.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/glib/gthread-posix.c b/glib/gthread-posix.c
index 9c0b032e6..1e2fdb59a 100644
--- a/glib/gthread-posix.c
+++ b/glib/gthread-posix.c
@@ -1177,7 +1177,7 @@ g_system_thread_new (GThreadFunc proxy,
#ifdef _SC_THREAD_STACK_MIN
long min_stack_size = sysconf (_SC_THREAD_STACK_MIN);
if (min_stack_size >= 0)
- stack_size = MAX (min_stack_size, stack_size);
+ stack_size = MAX ((gulong) min_stack_size, stack_size);
#endif /* _SC_THREAD_STACK_MIN */
/* No error check here, because some systems can't do it and
* we simply don't want threads to fail because of that. */