From e248d685833a498e7dc0938bca47f08dfa611cd5 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 4 Oct 2016 10:28:18 +0300 Subject: [PATCH] Eliminate 'potential overflow' static analyzer warning in test * tests/subthread_create.c (entry): Replace (int)(int_v1 - uint_v2) expression with int_v1 - (int)uint_v2. --- tests/subthread_create.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/subthread_create.c b/tests/subthread_create.c index be578965..fb1a728d 100644 --- a/tests/subthread_create.c +++ b/tests/subthread_create.c @@ -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; -- 2.50.1