Eliminate 'potential overflow' static analyzer warning in test
authorIvan Maidanski <ivmai@mail.ru>
Tue, 4 Oct 2016 07:28:18 +0000 (10:28 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 4 Oct 2016 07:28:18 +0000 (10:28 +0300)
* tests/subthread_create.c (entry): Replace (int)(int_v1 - uint_v2)
expression with int_v1 - (int)uint_v2.

tests/subthread_create.c

index be57896..fb1a728 100644 (file)
@@ -54,7 +54,7 @@ volatile AO_t thread_ended_cnt = 0;
     if (my_depth <= MAX_SUBTHREAD_DEPTH
             && thread_num < MAX_SUBTHREAD_COUNT
             && (thread_num % DECAY_DENOM) < DECAY_NUMER
-            && (int)(thread_num - AO_load(&thread_ended_cnt))
+            && thread_num - (int)AO_load(&thread_ended_cnt)
                 <= MAX_ALIVE_THREAD_COUNT) {
 # ifdef GC_PTHREADS
         int err;