diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2011-09-14 21:52:49 +0400 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2011-09-14 21:52:49 +0400 |
commit | 47e74a0090ee55945ab0207afbcbdedef969ec47 (patch) | |
tree | 6023c4e203ec247b40dc2d53dc4f24907ba86b24 | |
parent | 2082770db88c2a1de0f7d24aa7637366ae9e1996 (diff) | |
download | bdwgc-47e74a0090ee55945ab0207afbcbdedef969ec47.tar.gz |
Replace ARGSUSED comment-based annotation with GCC 'unused' attribute.
Turn on unused-parameter checking for GCC.
* alloc.c (GC_try_to_collect_general): Add GC_ATTR_UNUSED attribute
to an argument.
* tests/test.c (tiny_reverse_test, thr_run_one_test): Likewise.
* backgraph.c (reset_back_edge, update_max_height): Replace ARGSUSED
annotation with GC_ATTR_UNUSED attribute for some arguments.
* checksums.c (GC_add_block): Likewise.
* dbg_mlc.c (GC_debug_change_stubborn, GC_debug_end_stubborn_change,
GC_check_heap_block): Likewise.
* finalize.c (GC_null_finalize_mark_proc): Likewise.
* gcj_mlc.c (GC_gcj_fake_mark_proc): Likewise.
* mark.c (GC_noop, clear_marks_for_block, GC_mark_and_push): Likewise.
* mark_rts.c (GC_push_conditional_with_exclusions,
GC_push_current_stack): Likewise.
* misc.c (GC_default_oom_fn, GC_do_blocking_inner): Likewise.
* os_dep.c (GC_fault_handler_openbsd, GC_fault_handler,
GC_remove_protection, GC_page_was_dirty, GC_page_was_ever_dirty):
Likewise.
* pthread_stop_world.c (GC_suspend_handler, GC_suspend_handler_inner):
Likewise.
* pthread_support.c (GC_do_blocking_inner): Likewise.
* stubborn.c (GC_change_stubborn, GC_end_stubborn_change): Likewise.
* tests/test.c (fail_proc1): Likewise.
* typd_mlc.c (GC_array_mark_proc): Likewise.
* win32_threads.c (GC_do_blocking_inner, DllMain): Likewise.
* include/private/gc_priv.h (GC_ATTR_UNUSED): Define new macro.
* cordxtra.c (CORD_ATTR_UNUSED): Likewise.
* cordxtra.c (CORD_nul_func, CORD_lf_close_proc): Replace ARGSUSED
annotation with CORD_ATTR_UNUSED attribute for an argument.
* mach_dep.c (GC_clear_stack_inner): Remove ARGSUSED annotation and
use "limit" argument in the function (to suppress compiler warning).
* misc.c (GC_clear_stack_inner): Remove ARGSUSED.
* tests/threadkey_test.c (on_thread_exit_inner, on_thread_exit):
Use all function arguments (to suppress compiler warning).
* configure.ac (CFLAGS): Remove "-Wno-unused-parameter" option.
-rw-r--r-- | TODO | 4 | ||||
-rw-r--r-- | alloc.c | 2 | ||||
-rw-r--r-- | backgraph.c | 8 | ||||
-rw-r--r-- | checksums.c | 3 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | cord/cordxtra.c | 26 | ||||
-rw-r--r-- | dbg_mlc.c | 9 | ||||
-rw-r--r-- | finalize.c | 3 | ||||
-rw-r--r-- | gcj_mlc.c | 9 | ||||
-rw-r--r-- | include/private/gc_priv.h | 8 | ||||
-rw-r--r-- | mach_dep.c | 3 | ||||
-rw-r--r-- | mark.c | 9 | ||||
-rw-r--r-- | mark_rts.c | 7 | ||||
-rw-r--r-- | misc.c | 8 | ||||
-rw-r--r-- | os_dep.c | 40 | ||||
-rw-r--r-- | pthread_stop_world.c | 8 | ||||
-rw-r--r-- | pthread_support.c | 3 | ||||
-rw-r--r-- | stubborn.c | 9 | ||||
-rw-r--r-- | tests/test.c | 7 | ||||
-rw-r--r-- | tests/threadkey_test.c | 4 | ||||
-rw-r--r-- | typd_mlc.c | 4 | ||||
-rw-r--r-- | win32_threads.c | 7 |
22 files changed, 83 insertions, 100 deletions
@@ -34,10 +34,6 @@ build_atomic_ops.sh[.cygwin]: Remove if really not needed. win32-pthreads/cygwin: compile GC_Create/ExitThread as well (in addition to GC_pthread_create); redirect the correspoding functions in gc.h. -Use GC_ATTR_UNUSED across the whole project (replace ARGSUSED annotation); -define GC_ATTR_UNUSED as empty for old GCC releases; -remove -Wno-unused-parameter from configure. - configure.ac: Add option to build GC via extra/gc.c compilation. Mac_files: Remove MacOS_config.h, MacOS_Test_config.h. @@ -927,7 +927,7 @@ STATIC void GC_finish_collection(void) /* If stop_func == 0 then GC_default_stop_func is used instead. */ STATIC GC_bool GC_try_to_collect_general(GC_stop_func stop_func, - GC_bool force_unmap) + GC_bool force_unmap GC_ATTR_UNUSED) { GC_bool result; # ifdef USE_MUNMAP diff --git a/backgraph.c b/backgraph.c index 60a9e0f9..04259f19 100644 --- a/backgraph.c +++ b/backgraph.c @@ -283,8 +283,8 @@ GC_INLINE void GC_apply_to_each_object(per_object_func f) GC_apply_to_all_blocks(per_object_helper, (word)f); } -/*ARGSUSED*/ -static void reset_back_edge(ptr_t p, size_t n_bytes, word gc_descr) +static void reset_back_edge(ptr_t p, size_t n_bytes GC_ATTR_UNUSED, + word gc_descr GC_ATTR_UNUSED) { /* Skip any free list links, or dropped blocks */ if (GC_HAS_DEBUG_INFO(p)) { @@ -400,8 +400,8 @@ STATIC ptr_t GC_deepest_obj = NULL; /* next GC. */ /* Set GC_max_height to be the maximum height we encounter, and */ /* GC_deepest_obj to be the corresponding object. */ -/*ARGSUSED*/ -static void update_max_height(ptr_t p, size_t n_bytes, word gc_descr) +static void update_max_height(ptr_t p, size_t n_bytes GC_ATTR_UNUSED, + word gc_descr GC_ATTR_UNUSED) { if (GC_is_marked(p) && GC_HAS_DEBUG_INFO(p)) { word p_height = 0; diff --git a/checksums.c b/checksums.c index 3f2af938..b3d3fa9f 100644 --- a/checksums.c +++ b/checksums.c @@ -146,8 +146,7 @@ STATIC void GC_update_check_page(struct hblk *h, int index) word GC_bytes_in_used_blocks = 0; -/*ARGSUSED*/ -STATIC void GC_add_block(struct hblk *h, word dummy) +STATIC void GC_add_block(struct hblk *h, word dummy GC_ATTR_UNUSED) { hdr * hhdr = HDR(h); size_t bytes = hhdr -> hb_sz; diff --git a/configure.ac b/configure.ac index 03dfe5c6..6d8a62b1 100644 --- a/configure.ac +++ b/configure.ac @@ -341,7 +341,7 @@ case "$host" in esac if test "$GCC" == yes; then - CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused-parameter" + CFLAGS="$CFLAGS -Wall -Wextra" fi AC_MSG_CHECKING(for xlc) diff --git a/cord/cordxtra.c b/cord/cordxtra.c index 5904d3b2..abb34f64 100644 --- a/cord/cordxtra.c +++ b/cord/cordxtra.c @@ -21,19 +21,21 @@ # include <string.h> # include <stdlib.h> # include <stdarg.h> + # include "cord.h" # include "ec.h" + # define I_HIDE_POINTERS /* So we get access to allocation lock. */ /* We use this for lazy file reading, */ - /* so that we remain independent */ - /* of the threads primitives. */ + /* so that we remain independent */ + /* of the threads primitives. */ # include "gc.h" /* For now we assume that pointer reads and writes are atomic, */ /* i.e. another thread always sees the state before or after */ -/* a write. This might be false on a Motorola M68K with */ +/* a write. This might be false on a Motorola M68K with */ /* pointers that are not 32-bit aligned. But there probably */ -/* aren't too many threads packages running on those. */ +/* aren't too many threads packages running on those. */ # define ATOMIC_WRITE(x,y) (x) = (y) # define ATOMIC_READ(x) (*(x)) @@ -45,8 +47,8 @@ # define SEEK_END 2 # endif -# define BUFSZ 2048 /* Size of stack allocated buffers when */ - /* we want large buffers. */ +# define BUFSZ 2048 /* Size of stack allocated buffers when */ + /* we want large buffers. */ typedef void (* oom_fn)(void); @@ -54,6 +56,12 @@ typedef void (* oom_fn)(void); ABORT("Out of memory\n"); } # define ABORT(msg) { fprintf(stderr, "%s\n", msg); abort(); } +#if __GNUC__ >= 4 +# define CORD_ATTR_UNUSED __attribute__((__unused__)) +#else +# define CORD_ATTR_UNUSED /* empty */ +#endif + CORD CORD_cat_char(CORD x, char c) { register char * string; @@ -425,8 +433,7 @@ void CORD_ec_append_cord(CORD_ec x, CORD s) x[0].ec_cord = CORD_cat(x[0].ec_cord, s); } -/*ARGSUSED*/ -char CORD_nul_func(size_t i, void * client_data) +char CORD_nul_func(size_t i CORD_ATTR_UNUSED, void * client_data) { return((char)(unsigned long)client_data); } @@ -551,8 +558,7 @@ char CORD_lf_func(size_t i, void * client_data) return(cl -> data[MOD_LINE_SZ(i)]); } -/*ARGSUSED*/ -void CORD_lf_close_proc(void * obj, void * client_data) +void CORD_lf_close_proc(void * obj, void * client_data CORD_ATTR_UNUSED) { if (fclose(((lf_state *)obj) -> lf_file) != 0) { ABORT("CORD_lf_close_proc: fclose failed"); @@ -610,11 +610,9 @@ GC_API void * GC_CALL GC_debug_malloc_atomic_ignore_off_page(size_t lb, return GC_debug_malloc(lb, OPT_RA s, i); } - /*ARGSUSED*/ - GC_API void GC_CALL GC_debug_change_stubborn(void *p) {} + GC_API void GC_CALL GC_debug_change_stubborn(void * p GC_ATTR_UNUSED) {} - /*ARGSUSED*/ - GC_API void GC_CALL GC_debug_end_stubborn_change(void *p) {} + GC_API void GC_CALL GC_debug_end_stubborn_change(void * p GC_ATTR_UNUSED) {} #endif /* !STUBBORN_ALLOC */ GC_API void * GC_CALL GC_debug_malloc_atomic(size_t lb, GC_EXTRA_PARAMS) @@ -924,8 +922,7 @@ STATIC void GC_print_all_smashed_proc(void) /* Check all marked objects in the given block for validity */ /* Avoid GC_apply_to_each_object for performance reasons. */ -/*ARGSUSED*/ -STATIC void GC_check_heap_block(struct hblk *hbp, word dummy) +STATIC void GC_check_heap_block(struct hblk *hbp, word dummy GC_ATTR_UNUSED) { struct hblkhdr * hhdr = HDR(hbp); size_t sz = hhdr -> hb_sz; @@ -278,8 +278,7 @@ STATIC void GC_ignore_self_finalize_mark_proc(ptr_t p) } } -/*ARGSUSED*/ -STATIC void GC_null_finalize_mark_proc(ptr_t p) {} +STATIC void GC_null_finalize_mark_proc(ptr_t p GC_ATTR_UNUSED) {} /* Possible finalization_marker procedures. Note that mark stack */ /* overflow is handled by the caller, and is not a disaster. */ @@ -56,11 +56,10 @@ GC_INNER ptr_t * GC_gcjobjfreelist = NULL; STATIC ptr_t * GC_gcjdebugobjfreelist = NULL; -/*ARGSUSED*/ -STATIC struct GC_ms_entry * GC_gcj_fake_mark_proc(word * addr, - struct GC_ms_entry *mark_stack_ptr, - struct GC_ms_entry *mark_stack_limit, - word env) +STATIC struct GC_ms_entry * GC_gcj_fake_mark_proc(word * addr GC_ATTR_UNUSED, + struct GC_ms_entry *mark_stack_ptr, + struct GC_ms_entry * mark_stack_limit GC_ATTR_UNUSED, + word env GC_ATTR_UNUSED) { ABORT("No client gcj mark proc is specified"); return mark_stack_ptr; diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index fc855c76..b11b4ff7 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -129,6 +129,14 @@ typedef char * ptr_t; /* A generic pointer to which we can add */ # include "gc_hdrs.h" #endif +#ifndef GC_ATTR_UNUSED +# if __GNUC__ >= 4 +# define GC_ATTR_UNUSED __attribute__((__unused__)) +# else +# define GC_ATTR_UNUSED /* empty */ +# endif +#endif /* !GC_ATTR_UNUSED */ + #if __GNUC__ >= 3 && !defined(LINT2) # define EXPECT(expr, outcome) __builtin_expect(expr,outcome) /* Equivalent to (expr), but predict that usually (expr)==outcome. */ @@ -279,10 +279,9 @@ GC_INNER void GC_with_callee_saves_pushed(void (*fn)(ptr_t, void *), #if defined(ASM_CLEAR_CODE) # ifdef LINT - /*ARGSUSED*/ ptr_t GC_clear_stack_inner(ptr_t arg, word limit) { - return(arg); + return limit ? arg : 0; /* use both arguments */ } /* The real version is in a .S file */ # endif @@ -25,8 +25,7 @@ /* We put this here to minimize the risk of inlining. */ /*VARARGS*/ #if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__CC_ARM) - /*ARGSUSED*/ - void GC_noop(void *p, ...) {} + void GC_noop(void * p GC_ATTR_UNUSED, ...) {} #else # ifdef __DMC__ void GC_noop(...) {} @@ -174,8 +173,7 @@ GC_INNER void GC_set_hdr_marks(hdr *hhdr) /* * Clear all mark bits associated with block h. */ -/*ARGSUSED*/ -static void clear_marks_for_block(struct hblk *h, word dummy) +static void clear_marks_for_block(struct hblk *h, word dummy GC_ATTR_UNUSED) { register hdr * hhdr = HDR(h); @@ -1358,11 +1356,10 @@ GC_INNER void GC_push_all(ptr_t bottom, ptr_t top) GC_PUSH_ONE_STACK(p, MARKED_FROM_REGISTER); } -/*ARGSUSED*/ GC_API struct GC_ms_entry * GC_CALL GC_mark_and_push(void *obj, mse *mark_stack_ptr, mse *mark_stack_limit, - void **src) + void ** src GC_ATTR_UNUSED) { hdr * hhdr; @@ -457,9 +457,8 @@ GC_API void GC_CALL GC_exclude_static_roots(void *b, void *e) } /* Invoke push_conditional on ranges that are not excluded. */ -/*ARGSUSED*/ STATIC void GC_push_conditional_with_exclusions(ptr_t bottom, ptr_t top, - GC_bool all) + GC_bool all GC_ATTR_UNUSED) { struct exclusion * next; ptr_t excl_start; @@ -623,8 +622,8 @@ STATIC void GC_push_all_stack_part_eager_sections(ptr_t lo, ptr_t hi, * seen. * FIXME: Merge with per-thread stuff. */ -/*ARGSUSED*/ -STATIC void GC_push_current_stack(ptr_t cold_gc_frame, void * context) +STATIC void GC_push_current_stack(ptr_t cold_gc_frame, + void * context GC_ATTR_UNUSED) { # if defined(THREADS) if (0 == cold_gc_frame) return; @@ -141,8 +141,8 @@ GC_bool GC_quiet = 0; /* used also in pcr_interface.c */ GC_INNER long GC_large_alloc_warn_interval = GC_LARGE_ALLOC_WARN_INTERVAL; /* Interval between unsuppressed warnings. */ -/*ARGSUSED*/ -STATIC void * GC_CALLBACK GC_default_oom_fn(size_t bytes_requested) +STATIC void * GC_CALLBACK GC_default_oom_fn( + size_t bytes_requested GC_ATTR_UNUSED) { return(0); } @@ -255,7 +255,6 @@ GC_INNER void GC_extend_size_map(size_t i) /* Clear the stack up to about limit. Return arg. This function is */ /* not static because it could also be errorneously defined in .S */ /* file, so this error would be caught by the linker. */ - /*ARGSUSED*/ void * GC_clear_stack_inner(void *arg, ptr_t limit) { word dummy[CLEAR_SIZE]; @@ -1578,8 +1577,7 @@ GC_API void * GC_CALL GC_call_with_gc_active(GC_fn_type fn, } /* This is nearly the same as in win32_threads.c */ -/*ARGSUSED*/ -STATIC void GC_do_blocking_inner(ptr_t data, void * context) +STATIC void GC_do_blocking_inner(ptr_t data, void * context GC_ATTR_UNUSED) { struct blocking_data * d = (struct blocking_data *) data; GC_ASSERT(GC_is_initialized); @@ -530,8 +530,7 @@ GC_INNER char * GC_get_maps(void) /* SIGSEGV and SIGPROF masked. Instead, use this custom one that */ /* works-around the issues. */ - /*ARGSUSED*/ - STATIC void GC_fault_handler_openbsd(int sig) + STATIC void GC_fault_handler_openbsd(int sig GC_ATTR_UNUSED) { siglongjmp(GC_jmp_buf_openbsd, 1); } @@ -889,8 +888,7 @@ GC_INNER word GC_page_size = 0; /* Some tools to implement HEURISTIC2 */ # define MIN_PAGE_SIZE 256 /* Smallest conceivable page size, bytes */ - /*ARGSUSED*/ - STATIC void GC_fault_handler(int sig) + STATIC void GC_fault_handler(int sig GC_ATTR_UNUSED) { LONGJMP(GC_jmp_buf, 1); } @@ -2675,9 +2673,9 @@ STATIC void GC_default_push_other_roots(void) # ifndef MPROTECT_VDB /* Ignore write hints. They don't help us here. */ - /*ARGSUSED*/ - GC_INNER void GC_remove_protection(struct hblk *h, word nblocks, - GC_bool is_ptrfree) {} + GC_INNER void GC_remove_protection(struct hblk * h GC_ATTR_UNUSED, + word nblocks GC_ATTR_UNUSED, + GC_bool is_ptrfree GC_ATTR_UNUSED) {} # endif #endif /* PROC_VDB || GWW_VDB */ @@ -2801,8 +2799,7 @@ STATIC void GC_default_push_other_roots(void) /* If the actual page size is different, this returns TRUE if any */ /* of the pages overlapping h are dirty. This routine may err on the */ /* side of labeling pages as dirty (and this implementation does). */ - /*ARGSUSED*/ - GC_INNER GC_bool GC_page_was_dirty(struct hblk *h) + GC_INNER GC_bool GC_page_was_dirty(struct hblk * h GC_ATTR_UNUSED) { return(TRUE); } @@ -2813,8 +2810,7 @@ STATIC void GC_default_push_other_roots(void) /* following default versions are adequate. */ # ifdef CHECKSUMS /* Could any valid GC heap pointer ever have been written to this page? */ - /*ARGSUSED*/ - GC_INNER GC_bool GC_page_was_ever_dirty(struct hblk *h) + GC_INNER GC_bool GC_page_was_ever_dirty(struct hblk * h GC_ATTR_UNUSED) { return(TRUE); } @@ -2827,9 +2823,9 @@ STATIC void GC_default_push_other_roots(void) /* (II) may be essential if we need to ensure that */ /* pointer-free system call buffers in the heap are */ /* not protected. */ - /*ARGSUSED*/ - GC_INNER void GC_remove_protection(struct hblk *h, word nblocks, - GC_bool is_ptrfree) {} + GC_INNER void GC_remove_protection(struct hblk * h GC_ATTR_UNUSED, + word nblocks GC_ATTR_UNUSED, + GC_bool is_ptrfree GC_ATTR_UNUSED) {} #endif /* DEFAULT_VDB */ #ifdef MANUAL_VDB @@ -2872,14 +2868,13 @@ STATIC void GC_default_push_other_roots(void) async_set_pht_entry_from_index(GC_dirty_pages, index); } - /*ARGSUSED*/ - GC_INNER void GC_remove_protection(struct hblk *h, word nblocks, - GC_bool is_ptrfree) {} + GC_INNER void GC_remove_protection(struct hblk * h GC_ATTR_UNUSED, + word nblocks GC_ATTR_UNUSED, + GC_bool is_ptrfree GC_ATTR_UNUSED) {} # ifdef CHECKSUMS /* Could any valid GC heap pointer ever have been written to this page? */ - /*ARGSUSED*/ - GC_INNER GC_bool GC_page_was_ever_dirty(struct hblk *h) + GC_INNER GC_bool GC_page_was_ever_dirty(struct hblk * h GC_ATTR_UNUSED) { /* FIXME - implement me. */ return(TRUE); @@ -3100,7 +3095,6 @@ STATIC void GC_default_push_other_roots(void) # ifndef NO_GETCONTEXT # include <ucontext.h> # endif - /*ARGSUSED*/ STATIC void GC_write_fault_handler(int sig, siginfo_t *si, void *raw_sc) # else # define SIG_OK (exc_info -> ExceptionRecord -> ExceptionCode \ @@ -3581,8 +3575,7 @@ ssize_t read(int fd, void *buf, size_t nbyte) #endif /* 0 */ # ifdef CHECKSUMS - /*ARGSUSED*/ - GC_INNER GC_bool GC_page_was_ever_dirty(struct hblk *h) + GC_INNER GC_bool GC_page_was_ever_dirty(struct hblk * h GC_ATTR_UNUSED) { # if defined(GWW_VDB) if (GC_GWW_AVAILABLE()) @@ -3782,9 +3775,8 @@ GC_INNER GC_bool GC_page_was_dirty(struct hblk *h) return(GC_grungy_bits[h - (struct hblk *)GC_vd_base] & PCR_VD_DB_dirtyBit); } -/*ARGSUSED*/ GC_INNER void GC_remove_protection(struct hblk *h, word nblocks, - GC_bool is_ptrfree) + GC_bool is_ptrfree GC_ATTR_UNUSED) { PCR_VD_WriteProtectDisable(h, nblocks*HBLKSIZE); PCR_VD_WriteProtectEnable(h, nblocks*HBLKSIZE); diff --git a/pthread_stop_world.c b/pthread_stop_world.c index fa4e4d5f..a94517e7 100644 --- a/pthread_stop_world.c +++ b/pthread_stop_world.c @@ -167,8 +167,8 @@ STATIC sem_t GC_suspend_ack_sem; STATIC void GC_suspend_handler_inner(ptr_t sig_arg, void *context); #ifdef SA_SIGINFO - /*ARGSUSED*/ - STATIC void GC_suspend_handler(int sig, siginfo_t *info, void *context) + STATIC void GC_suspend_handler(int sig, siginfo_t * info GC_ATTR_UNUSED, + void * context GC_ATTR_UNUSED) #else STATIC void GC_suspend_handler(int sig) #endif @@ -189,8 +189,8 @@ STATIC void GC_suspend_handler_inner(ptr_t sig_arg, void *context); # endif } -/*ARGSUSED*/ -STATIC void GC_suspend_handler_inner(ptr_t sig_arg, void *context) +STATIC void GC_suspend_handler_inner(ptr_t sig_arg, + void * context GC_ATTR_UNUSED) { pthread_t self = pthread_self(); GC_thread me; diff --git a/pthread_support.c b/pthread_support.c index 377cbbf5..848756cc 100644 --- a/pthread_support.c +++ b/pthread_support.c @@ -1047,8 +1047,7 @@ GC_INNER void GC_init_parallel(void) /* Wrapper for functions that are likely to block for an appreciable */ /* length of time. */ -/*ARGSUSED*/ -GC_INNER void GC_do_blocking_inner(ptr_t data, void * context) +GC_INNER void GC_do_blocking_inner(ptr_t data, void * context GC_ATTR_UNUSED) { struct blocking_data * d = (struct blocking_data *) data; GC_thread me; @@ -34,8 +34,7 @@ GC_dirty(p); } - /*ARGSUSED*/ - GC_API void GC_CALL GC_change_stubborn(void *p) + GC_API void GC_CALL GC_change_stubborn(void *p GC_ATTR_UNUSED) { } @@ -46,13 +45,11 @@ return(GC_malloc(lb)); } - /*ARGSUSED*/ - GC_API void GC_CALL GC_end_stubborn_change(void *p) + GC_API void GC_CALL GC_end_stubborn_change(void *p GC_ATTR_UNUSED) { } - /*ARGSUSED*/ - GC_API void GC_CALL GC_change_stubborn(void *p) + GC_API void GC_CALL GC_change_stubborn(void *p GC_ATTR_UNUSED) { } diff --git a/tests/test.c b/tests/test.c index e2f7a01e..892265a0 100644 --- a/tests/test.c +++ b/tests/test.c @@ -462,7 +462,7 @@ void check_marks_int_list(sexpr x) # if defined(GC_WIN32_THREADS) && !defined(GC_PTHREADS) DWORD __stdcall tiny_reverse_test(void * arg) # else - void * tiny_reverse_test(void * arg) + void * tiny_reverse_test(void * arg GC_ATTR_UNUSED) # endif { int i; @@ -1000,8 +1000,7 @@ void typed_test(void) int fail_count = 0; -/*ARGSUSED*/ -void GC_CALLBACK fail_proc1(void * x) +void GC_CALLBACK fail_proc1(void *x GC_ATTR_UNUSED) { fail_count++; } @@ -1648,7 +1647,7 @@ int test(void) #endif #if defined(GC_PTHREADS) -void * thr_run_one_test(void * arg) +void * thr_run_one_test(void * arg GC_ATTR_UNUSED) { run_one_test(); return(0); diff --git a/tests/threadkey_test.c b/tests/threadkey_test.c index d080a7ba..49ee51ff 100644 --- a/tests/threadkey_test.c +++ b/tests/threadkey_test.c @@ -52,12 +52,12 @@ void * GC_CALLBACK on_thread_exit_inner (struct GC_stack_base * sb, void * arg) if (res == GC_SUCCESS) GC_unregister_my_thread (); - return (void*)(GC_word)creation_res; + return arg ? (void*)(GC_word)creation_res : 0; } void on_thread_exit (void *v) { - GC_call_with_stack_base (on_thread_exit_inner, NULL); + GC_call_with_stack_base (on_thread_exit_inner, v); } void make_key (void) @@ -493,9 +493,9 @@ STATIC mse * GC_push_complex_descriptor(word *addr, complex_descriptor *d, } } -/*ARGSUSED*/ STATIC mse * GC_array_mark_proc(word * addr, mse * mark_stack_ptr, - mse * mark_stack_limit, word env) + mse * mark_stack_limit, + word env GC_ATTR_UNUSED) { hdr * hhdr = HDR(addr); size_t sz = hhdr -> hb_sz; diff --git a/win32_threads.c b/win32_threads.c index 0c841107..1fa04456 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -798,8 +798,7 @@ GC_API int GC_CALL GC_unregister_my_thread(void) /* length of time. */ /* GC_do_blocking_inner() is nearly the same as in pthread_support.c */ -/*ARGSUSED*/ -GC_INNER void GC_do_blocking_inner(ptr_t data, void * context) +GC_INNER void GC_do_blocking_inner(ptr_t data, void * context GC_ATTR_UNUSED) { struct blocking_data * d = (struct blocking_data *) data; DWORD thread_id = GetCurrentThreadId(); @@ -2570,8 +2569,8 @@ GC_INNER void GC_thr_init(void) /* collector. (The alternative of initializing the collector here */ /* seems dangerous, since DllMain is limited in what it can do.) */ - /*ARGSUSED*/ - BOOL WINAPI DllMain(HINSTANCE inst, ULONG reason, LPVOID reserved) + BOOL WINAPI DllMain(HINSTANCE inst GC_ATTR_UNUSED, ULONG reason, + LPVOID reserved GC_ATTR_UNUSED) { struct GC_stack_base sb; DWORD thread_id; |