Skip to content

Commit

Permalink
Fix 'function-to-object pointer conversion' gcc warning in GC_save_ca…
Browse files Browse the repository at this point in the history
…llers

(fix of commit b2552e0)

Issue #627 (bdwgc).

* os_dep.c [NEED_CALLINFO && SAVE_CALL_CHAIN && NARGS == 0
&& NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE && REDIRECT_MALLOC
&& THREADS && DBG_HDRS_ALL] (GC_save_callers_no_unlock): Use
CAST_THRU_UINTPTR() to set info[0].ci_pc.
* os_dep.c [NEED_CALLINFO && SAVE_CALL_CHAIN && NARGS == 0
&& NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE && REDIRECT_MALLOC]
(GC_save_callers): Likewise.
  • Loading branch information
ivmai committed Jul 29, 2024
1 parent 36b3f2f commit 0e64814
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions os_dep.c
Original file line number Diff line number Diff line change
Expand Up @@ -5291,7 +5291,8 @@ GC_API int GC_CALL GC_get_pages_executable(void)
struct callinfo info[NFRAMES])
{
GC_ASSERT(I_HOLD_LOCK());
info[0].ci_pc = (GC_return_addr_t)(&GC_save_callers_no_unlock);
info[0].ci_pc = CAST_THRU_UINTPTR(GC_return_addr_t,
GC_save_callers_no_unlock);
BZERO(&info[1], sizeof(void *) * (NFRAMES - 1));
}
# endif
Expand All @@ -5310,7 +5311,8 @@ GC_API int GC_CALL GC_get_pages_executable(void)
GC_STATIC_ASSERT(sizeof(struct callinfo) == sizeof(void *));
# ifdef REDIRECT_MALLOC
if (GC_in_save_callers) {
info[0].ci_pc = (GC_return_addr_t)(&GC_save_callers);
info[0].ci_pc = CAST_THRU_UINTPTR(GC_return_addr_t,
GC_save_callers);
BZERO(&info[1], sizeof(void *) * (NFRAMES - 1));
return;
}
Expand Down

0 comments on commit 0e64814

Please sign in to comment.