From 8931954d28cd73e672909438a3c8fc3e2b4fe8c2 Mon Sep 17 00:00:00 2001 From: Till Straumann Date: Mon, 8 Sep 2014 22:30:34 -0700 Subject: [PATCH] - fixed illegal void* pointer arithmetic (by casting to char*) --- src/libCom/test/epicsStackTraceTest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libCom/test/epicsStackTraceTest.c b/src/libCom/test/epicsStackTraceTest.c index 9bc893c0f..c42206b11 100644 --- a/src/libCom/test/epicsStackTraceTest.c +++ b/src/libCom/test/epicsStackTraceTest.c @@ -129,7 +129,7 @@ int n_ptrs = 0; int i,j; int rval = 0; - while ( n_ptrs < sizeof(ptrs)/sizeof(*ptrs[0]) && (buf=strchr(buf,'[')) ) { + while ( n_ptrs < sizeof(ptrs)/sizeof(ptrs[0]) && (buf=strchr(buf,'[')) ) { if ( 1 == sscanf(buf+1,"%p", &ptrs[n_ptrs]) ) n_ptrs++; buf++; @@ -142,7 +142,7 @@ int rval = 0; j = i; while ( j < n_ptrs ) { if ( j != i && ptrs[j] == ptrs[i] ) { - if ( ptrs[i] >= (void*)epicsStackTraceRecurseGbl && ptrs[i] < (void*)epicsStackTraceRecurseGbl + WINDOW_SZ ) { + if ( (char*)ptrs[i] >= (char*)epicsStackTraceRecurseGbl && (char*)ptrs[i] < (char*)epicsStackTraceRecurseGbl + WINDOW_SZ ) { rval ++; if ( test_debug ) testDiag("found address %p again\n", ptrs[i]);