Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mini] fix some warnings with newer GCC (#8308)
* [interp] fix warning ``` interp/interp.c: In function ‘ves_real_abort’: interp/interp.c:251:17: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘int’ [-Wformat=] printf ("\t[%ld] 0x%08x %0.5f\n", sp-stack, sp[-1].data.i, sp[-1].data.f); ~~^ ~~~~~~~~ %d ``` * [mini] ignore GCC warning in trace.c ``` trace.c: In function ‘mono_trace_enter_method’: trace.c:145:3: warning: calling ‘__builtin_return_address’ with a nonzero argument is unsafe [-Wframe-address] printf (") ip: %p\n", MONO_RETURN_ADDRESS_N (1)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` * [tramp-x86] remove unused function ``` tramp-x86.c:171:1: warning: ‘get_vcall_slot_addr’ defined but not used [-Wunused-function] get_vcall_slot_addr (guint8* code, mgreg_t *regs) ^~~~~~~~~~~~~~~~~~~ ``` * [mini-x86] remove unused function ``` mini-x86.c:6327:1: warning: ‘emit_load_aotconst’ defined but not used [-Wunused-function] emit_load_aotconst (guint8 *start, guint8 *code, MonoCompile *cfg, MonoJumpInfo **ji, int dreg, int tramp_type, gconstpointer target) ^~~~~~~~~~~~~~~~~~ ``` * [tramp-x86] remove unused function ``` tramp-x86.c:146:1: warning: ‘get_vcall_slot’ defined but not used [-Wunused-function] get_vcall_slot (guint8 *code, mgreg_t *regs, int *displacement) ^~~~~~~~~~~~~~ ``` * [mini-x86] change previous_lmf to pointer type (same as amd64) ``` mini-runtime.c: In function ‘mono_push_lmf’: mini-runtime.c:806:24: warning: assignment makes integer from pointer without a cast [-Wint-conversion] ext->lmf.previous_lmf = *lmf_addr; ^ mini-runtime.c:808:24: warning: assignment makes integer from pointer without a cast [-Wint-conversion] ext->lmf.previous_lmf = (gpointer)(((gssize)ext->lmf.previous_lmf) | 2); ^ mini-exceptions.c: In function ‘arch_unwind_frame’: mini-exceptions.c:420:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] *lmf = (MonoLMF *)(((guint64)(*lmf)->previous_lmf) & ~3); ^ mini-exceptions.c: In function ‘unwinder_unwind_frame’: mini-exceptions.c:715:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] *lmf = (MonoLMF *)(((guint64)(*lmf)->previous_lmf) & ~7); ^ ``` * [monolmf/x86] make int cast dependend one machine word size ``` In file included from debugger-agent.c:36:0: debugger-agent.c: In function ‘get_top_method_ji’: debugger-agent.c:2501:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] g_assert (((guint64)lmf->previous_lmf) & 2); ^ ../../mono/eglib/glib.h:710:46: note: in definition of macro ‘G_UNLIKELY’ #define G_UNLIKELY(expr) (__builtin_expect ((expr) != 0, 0)) ^~~~ debugger-agent.c:2501:3: note: in expansion of macro ‘g_assert’ g_assert (((guint64)lmf->previous_lmf) & 2); ^~~~~~~~ ``` * [interp] remove unnecessary code * [mini] fix ptr with int cmp this was wrongly changed. ``` mini-exceptions.c: In function ‘unwinder_unwind_frame’: mini-exceptions.c:702:33: warning: comparison between pointer and integer if (unwinder->last_frame_addr > (gsize)(*lmf)) { ^ ```
- Loading branch information
1 parent
cc3666f
commit 384c4a4
Showing
8 changed files
with
12 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@lewurm this in turn causes a warning on clang for me: