summaryrefslogtreecommitdiff
path: root/mark.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-09-15 08:14:08 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-09-15 10:23:49 +0300
commit77c069df3ea02551fcf82e0ccd8ea2e68739ac3c (patch)
tree7b7e70499567fbf655fe102298c146315995571f /mark.c
parenta8e6d322879051cc4862d2055eeb2ffa5a3d0db4 (diff)
downloadbdwgc-77c069df3ea02551fcf82e0ccd8ea2e68739ac3c.tar.gz
Use cast to void instead of the attribute to indicate unused arguments
(refactoring) * CMakeLists.txt [BORLAND] (add_compile_options): Remove "/w-par"; reorder options. * CMakeLists.txt [!BORLAND && MSVC] (add_compile_options): Remove "/wd4100"; update comment. * NT_MAKEFILE (.c.obj): Likewise. * allchblk.c [!NO_DEBUGGING || GC_ASSERTIONS] (add_hb_sz): Use UNUSED_ARG() instead of GC_ATTR_UNUSED. * allchblk.c [USE_MUNMAP] (GC_adjust_num_unmapped): Likewise. * backgraph.c [MAKE_BACK_GRAPH] (pop_in_progress, reset_back_edge, update_max_height): Likewise. * checksums.c [CHECKSUMS] (GC_add_block): Likewise. * darwin_stop_world.c (GC_stack_range_for): Likewise. * dbg_mlc.c (GC_store_debug_info_inner, GC_debug_change_stubborn, GC_check_heap_block): Likewise. * finalize.c [!GC_NO_FINALIZATION] (GC_null_finalize_mark_proc): Likewise. * gcj_mlc.c [GC_GCJ_SUPPORT] (GC_gcj_fake_mark_proc): Likewise. * mallocx.c [!CPPCHECK] (GC_change_stubborn): Likewise. * mark.c (GC_noop6, clear_marks_for_block): Likewise. * mark.c [WRAP_MARK_SOME && (MSWIN32 || MSWINCE) && __GNUC__] (mark_ex_handler): Likewise. * mark.c [GC_DISABLE_INCREMENTAL] (GC_push_conditional): Likewise. * mark_rts.c (GC_push_current_stack, GC_push_roots): Likewise. * misc.c (GC_default_oom_fn, GC_set_handle_fork): Likewise. * misc.c [THREADS && !SIGNAL_BASED_STOP_WORLD] (GC_set_suspend_signal, GC_set_thr_restart_signal): Likewise. * misc.c [THREADS && UNIX_LIKE && !NO_GETCONTEXT] (callee_saves_pushed_dummy_fn): Likewise. * misc.c [!THREADS] (GC_do_blocking_inner): Likewise. * misc.c [!PARALLEL_MARK] (GC_set_markers_count): Likewise. * os_dep.c [OPENBSD] (GC_fault_handler_openbsd): Likewise. * os_dep.c [NEED_FIND_LIMIT || WRAP_MARK_SOME && !MSWIN32 && !MSWINCE || USE_PROC_FOR_LIBRARIES && THREADS] (GC_fault_handler): Likewise. * os_dep.c [!HAVE_GET_STACK_BASE && !NEED_FIND_LIMIT] (GC_get_stack_base): Likewise. * os_dep.c [MPROTECT_VDB && DARWIN] (catch_exception_raise_state, catch_exception_raise_state_identity, catch_exception_raise): Likewise. * pthread_stop_world.c [!NACL && !GC_OPENBSD_UTHREADS && !SUSPEND_HANDLER_NO_CONTEXT] (GC_suspend_sigaction): Likewise. * pthread_stop_world.c [!NACL && !GC_OPENBSD_UTHREADS] (GC_suspend_handler_inner): Likewise. * pthread_support.c (GC_do_blocking_inner): Likewise. * pthread_support.c [GC_ENABLE_SUSPEND_THREAD && SIGNAL_BASED_STOP_WORLD] (GC_suspend_self_blocked): Likewise. * tests/gctest.c [!DBG_HDRS_ALL] (fail_proc1): Likewise. * tests/gctest.c [(MSWIN32 && !__MINGW32__ || MSWINCE) && !NO_WINMAIN_ENTRY] (WinMain): Likewise. * tests/gctest.c [!PCR && !GC_WIN32_THREADS && !GC_PTHREADS && CPPCHECK && RTEMS] (Init): Likewise. * tests/gctest.c [GC_WIN32_THREADS && !GC_PTHREADS] (thr_run_one_test): Likewise. * tests/gctest.c [MSWINCE] (thr_window): Likewise. * tests/gctest.c [GC_PTHREADS] (thr_run_one_test): Likewise. * typd_mlc.c (GC_array_mark_proc): Likewise. * win32_threads.c (GC_register_altstack, GC_do_blocking_inner): Likewise. * win32_threads.c [!GC_PTHREADS && !GC_NO_THREADS_DISCOVERY] (GC_DllMain): Likewise. * cord/cordxtra.c (CORD_ATTR_UNUSED): Remove. * include/private/gc_priv.h [!GC_ATTR_UNUSED] (GC_ATTR_UNUSED): Likewise. * cord/cordxtra.c (CORD_nul_func): Cast unused argument to void instead of using CORD_ATTR_UNUSED. * cord/cordxtra.c [!GC_NO_FINALIZATION] (CORD_lf_close_proc): Likewise. * include/private/gc_priv.h [!UNUSED_ARG] (UNUSED_ARG): Define macro.
Diffstat (limited to 'mark.c')
-rw-r--r--mark.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/mark.c b/mark.c
index 469a2c4d..9f39af5c 100644
--- a/mark.c
+++ b/mark.c
@@ -36,10 +36,14 @@
/* Make arguments appear live to compiler. Put here to minimize the */
/* risk of inlining. Used to minimize junk left in registers. */
GC_ATTR_NOINLINE
-void GC_noop6(word arg1 GC_ATTR_UNUSED, word arg2 GC_ATTR_UNUSED,
- word arg3 GC_ATTR_UNUSED, word arg4 GC_ATTR_UNUSED,
- word arg5 GC_ATTR_UNUSED, word arg6 GC_ATTR_UNUSED)
+void GC_noop6(word arg1, word arg2, word arg3, word arg4, word arg5, word arg6)
{
+ UNUSED_ARG(arg1);
+ UNUSED_ARG(arg2);
+ UNUSED_ARG(arg3);
+ UNUSED_ARG(arg4);
+ UNUSED_ARG(arg5);
+ UNUSED_ARG(arg6);
/* Avoid GC_noop6 calls to be optimized away. */
# if defined(AO_HAVE_compiler_barrier) && !defined(BASE_ATOMIC_OPS_EMULATED)
AO_compiler_barrier(); /* to serve as a special side-effect */
@@ -166,11 +170,11 @@ GC_INNER void GC_set_hdr_marks(hdr *hhdr)
}
/* Clear all mark bits associated with block h. */
-static void GC_CALLBACK clear_marks_for_block(struct hblk *h,
- GC_word dummy GC_ATTR_UNUSED)
+static void GC_CALLBACK clear_marks_for_block(struct hblk *h, GC_word dummy)
{
hdr * hhdr = HDR(h);
+ UNUSED_ARG(dummy);
if (IS_UNCOLLECTABLE(hhdr -> hb_obj_kind)) return;
/* Mark bit for these is cleared only once the object is */
/* explicitly deallocated. This either frees the block, or */
@@ -433,11 +437,10 @@ static void push_roots_and_advance(GC_bool push_all, ptr_t cold_gc_frame)
} ext_ex_regn;
static EXCEPTION_DISPOSITION mark_ex_handler(
- struct _EXCEPTION_RECORD *ex_rec,
- void *est_frame,
- struct _CONTEXT *context,
- void *disp_ctxt GC_ATTR_UNUSED)
+ struct _EXCEPTION_RECORD *ex_rec, void *est_frame,
+ struct _CONTEXT *context, void *disp_ctxt)
{
+ UNUSED_ARG(disp_ctxt);
if (ex_rec->ExceptionCode == STATUS_ACCESS_VIOLATION) {
ext_ex_regn *xer = (ext_ex_regn *)est_frame;
@@ -1442,9 +1445,9 @@ GC_API void GC_CALL GC_push_all(void *bottom, void *top)
# endif /* !NO_VDB_FOR_STATIC_ROOTS */
#else
- GC_API void GC_CALL GC_push_conditional(void *bottom, void *top,
- int all GC_ATTR_UNUSED)
+ GC_API void GC_CALL GC_push_conditional(void *bottom, void *top, int all)
{
+ UNUSED_ARG(all);
GC_push_all(bottom, top);
}
#endif /* GC_DISABLE_INCREMENTAL */