diff --git a/CHANGELOG.md b/CHANGELOG.md index fbb77517..1830db8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ Bug Fixes - Properly handle literal vectors at the top level of compiled code. - Properly escape C strings in compiled code to avoid trigraphs. - Eliminate clang compiler warnings referencing `EOF` when building the runtime. +- Prevent warnings from the C compiler regarding string comparison for emitted code using `Cyc_st_add`. ## 0.30.0 - July 2, 2021 diff --git a/include/cyclone/runtime.h b/include/cyclone/runtime.h index f50212a5..a71be75b 100644 --- a/include/cyclone/runtime.h +++ b/include/cyclone/runtime.h @@ -723,8 +723,10 @@ object copy2heap(void *data, object obj); #define Cyc_st_add(data, frame) \ { \ gc_thread_data *thd = (gc_thread_data *) data; \ + intptr_t p1 = (intptr_t)frame; \ + intptr_t p2 = (intptr_t)thd->stack_prev_frame; \ /* Do not allow recursion to remove older frames */ \ - if ((void *)frame != (void *)thd->stack_prev_frame) { \ + if (p1 != p2) { \ thd->stack_prev_frame = frame; \ thd->stack_traces[thd->stack_trace_idx] = frame; \ thd->stack_trace_idx = (thd->stack_trace_idx + 1) % MAX_STACK_TRACES; \