From: Ivan Maidanski Date: Wed, 17 Aug 2016 06:44:31 +0000 (+0300) Subject: Fix 'incompatible pointer' compiler warning in GC_init_dyld (OS X 64-bit) X-Git-Tag: v8.0.0~1171 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6909c54e5a51bf8e2506efd4f1d8ec3a9d1e19d9;p=gc Fix 'incompatible pointer' compiler warning in GC_init_dyld (OS X 64-bit) * dyn_load.c (GC_init_dyld): Cast _dyld_register_func_for_add_image and _dyld_register_func_for_remove_image argument to void compiler warning about incompatible pointer types; update relevant comment. --- diff --git a/dyn_load.c b/dyn_load.c index 614f1d10..cf3edec8 100644 --- a/dyn_load.c +++ b/dyn_load.c @@ -1440,12 +1440,13 @@ GC_INNER void GC_init_dyld(void) This WILL properly register already linked libraries and libraries linked in the future. */ - - _dyld_register_func_for_add_image(GC_dyld_image_add); - _dyld_register_func_for_remove_image(GC_dyld_image_remove); - /* Ignore 2 compiler warnings here: passing argument 1 of */ - /* '_dyld_register_func_for_add/remove_image' from incompatible */ - /* pointer type. */ + _dyld_register_func_for_add_image( + (void (*)(const struct mach_header*, intptr_t))GC_dyld_image_add); + _dyld_register_func_for_remove_image( + (void (*)(const struct mach_header*, intptr_t))GC_dyld_image_remove); + /* Structure mach_header64 has the same fields */ + /* as mach_header except for the reserved one */ + /* at the end, so these casts are OK. */ /* Set this early to avoid reentrancy issues. */ initialized = TRUE;