Issue #466 - Prevent compiler warnings regarding Cyc_st_add and string comparisons

Were seeing newer versions of clang spamming warnings due to how we were comparing strings here.
This commit is contained in:
Justin Ethier 2021-07-16 13:02:50 -07:00
parent e21735512e
commit d3ab710bb4
2 changed files with 4 additions and 1 deletions

View file

@ -8,6 +8,7 @@ Bug Fixes
- Properly handle literal vectors at the top level of compiled code. - Properly handle literal vectors at the top level of compiled code.
- Properly escape C strings in compiled code to avoid trigraphs. - Properly escape C strings in compiled code to avoid trigraphs.
- Eliminate clang compiler warnings referencing `EOF` when building the runtime. - 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 ## 0.30.0 - July 2, 2021

View file

@ -723,8 +723,10 @@ object copy2heap(void *data, object obj);
#define Cyc_st_add(data, frame) \ #define Cyc_st_add(data, frame) \
{ \ { \
gc_thread_data *thd = (gc_thread_data *) data; \ 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 */ \ /* 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_prev_frame = frame; \
thd->stack_traces[thd->stack_trace_idx] = frame; \ thd->stack_traces[thd->stack_trace_idx] = frame; \
thd->stack_trace_idx = (thd->stack_trace_idx + 1) % MAX_STACK_TRACES; \ thd->stack_trace_idx = (thd->stack_trace_idx + 1) % MAX_STACK_TRACES; \