From 1bdad3666a13aa506297fb8a816e1460c5fa1b22 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 3 Nov 2017 00:58:18 +0300 Subject: [PATCH] Eliminate TSan warning about A.dummy in gctest * tests/test.c (reverse_test_inner): Move A.dummy=17 to set_print_procs(). * tests/test.c (set_print_procs): Add comment. --- tests/test.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test.c b/tests/test.c index a4b1bd1..5fa46fa 100644 --- a/tests/test.c +++ b/tests/test.c @@ -669,7 +669,6 @@ void *GC_CALLBACK reverse_test_inner(void *data) # define BIG 4500 # endif - A.dummy = 17; a_set(ints(1, 49)); b = ints(1, 50); c = ints(1, BIG); @@ -1198,7 +1197,7 @@ void typed_test(void) } #ifdef DBG_HDRS_ALL -# define set_print_procs() (void)0 +# define set_print_procs() (void)(A.dummy = 17) #else int fail_count = 0; @@ -1209,6 +1208,8 @@ void typed_test(void) void set_print_procs(void) { + /* Set these global variables just once to avoid TSan false positives. */ + A.dummy = 17; GC_is_valid_displacement_print_proc = fail_proc1; GC_is_visible_print_proc = fail_proc1; } -- 2.7.4