From: Paul Floyd Date: Fri, 25 Aug 2023 21:00:58 +0000 (+0200) Subject: Fix various clang warnings X-Git-Tag: VALGRIND_3_22_0~116 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75321f92b183c545e6690fd24f0725a24650bf50;p=thirdparty%2Fvalgrind.git Fix various clang warnings Mostly missing 'void' in function prototypes. --- diff --git a/VEX/priv/guest_mips_helpers.c b/VEX/priv/guest_mips_helpers.c index 5845e483e4..74cfb9c34c 100644 --- a/VEX/priv/guest_mips_helpers.c +++ b/VEX/priv/guest_mips_helpers.c @@ -1274,7 +1274,7 @@ extern UInt mips_dirtyhelper_calculate_MSACSR ( void* gs, UInt ws, UInt wt, return ret; } -extern UInt mips_dirtyhelper_get_MSAIR() { +extern UInt mips_dirtyhelper_get_MSAIR(void) { UInt ret = 0; /* GCC 4.8 and later support MIPS MSA. */ #if defined(__mips__) && (defined(__clang__) || (GCC_VERSION >= 408)) diff --git a/cachegrind/cg_arch.c b/cachegrind/cg_arch.c index 6ff2247e84..8858b0ee6d 100644 --- a/cachegrind/cg_arch.c +++ b/cachegrind/cg_arch.c @@ -311,7 +311,7 @@ void VG_(post_clo_init_configure_caches)(cache_t* I1c, #undef DEFINED } -void VG_(print_cache_clo_opts)() +void VG_(print_cache_clo_opts)(void) { VG_(printf)( " --I1=,, set I1 cache manually\n" diff --git a/callgrind/bb.c b/callgrind/bb.c index da64caa13e..a599c10a55 100644 --- a/callgrind/bb.c +++ b/callgrind/bb.c @@ -33,7 +33,7 @@ /* BB hash, resizable */ bb_hash bbs; -void CLG_(init_bb_hash)() +void CLG_(init_bb_hash)(void) { Int i; @@ -45,7 +45,7 @@ void CLG_(init_bb_hash)() for (i = 0; i < bbs.size; i++) bbs.table[i] = NULL; } -bb_hash* CLG_(get_bb_hash)() +bb_hash* CLG_(get_bb_hash)(void) { return &bbs; } diff --git a/callgrind/bbcc.c b/callgrind/bbcc.c index 619d400019..d197f3dee0 100644 --- a/callgrind/bbcc.c +++ b/callgrind/bbcc.c @@ -61,7 +61,7 @@ void CLG_(copy_current_bbcc_hash)(bbcc_hash* dst) dst->table = current_bbccs.table; } -bbcc_hash* CLG_(get_current_bbcc_hash)() +bbcc_hash* CLG_(get_current_bbcc_hash)(void) { return ¤t_bbccs; } diff --git a/callgrind/callstack.c b/callgrind/callstack.c index 96dfc995a5..fc1d6eeab1 100644 --- a/callgrind/callstack.c +++ b/callgrind/callstack.c @@ -309,7 +309,7 @@ void CLG_(push_call_stack)(BBCC* from, UInt jmp, BBCC* to, Addr sp, Bool skip) * * If the JCC becomes inactive, call entries are freed if possible */ -void CLG_(pop_call_stack)() +void CLG_(pop_call_stack)(void) { jCC* jcc; Int depth = 0; diff --git a/callgrind/context.c b/callgrind/context.c index 459c6e6ab1..81261bdf1c 100644 --- a/callgrind/context.c +++ b/callgrind/context.c @@ -67,7 +67,7 @@ void CLG_(set_current_fn_stack)(fn_stack* s) static cxt_hash cxts; -void CLG_(init_cxt_table)() +void CLG_(init_cxt_table)(void) { Int i; diff --git a/callgrind/dump.c b/callgrind/dump.c index 368a740b46..7f9f59f92a 100644 --- a/callgrind/dump.c +++ b/callgrind/dump.c @@ -1581,7 +1581,7 @@ void init_cmdbuf(void) * This function has to be called every time a profile dump is generated * to be able to react on PID changes. */ -void CLG_(init_dumps)() +void CLG_(init_dumps)(void) { SysRes res; diff --git a/callgrind/fn.c b/callgrind/fn.c index 45d26ed43f..27ad4988a0 100644 --- a/callgrind/fn.c +++ b/callgrind/fn.c @@ -300,7 +300,7 @@ static Bool search_runtime_resolve(obj_node* obj) /* Object hash table, fixed */ static obj_node* obj_table[N_OBJ_ENTRIES]; -void CLG_(init_obj_table)() +void CLG_(init_obj_table)(void) { Int i; for (i = 0; i < N_OBJ_ENTRIES; i++) @@ -741,7 +741,7 @@ void CLG_(copy_current_fn_array)(fn_array* dst) dst->array = current_fn_active.array; } -fn_array* CLG_(get_current_fn_array)() +fn_array* CLG_(get_current_fn_array)(void) { return ¤t_fn_active; } diff --git a/callgrind/sim.c b/callgrind/sim.c index 104c63492e..90e6134319 100644 --- a/callgrind/sim.c +++ b/callgrind/sim.c @@ -1593,7 +1593,7 @@ void cachesim_printstat(Int l1, Int l2, Int l3) struct event_sets CLG_(sets); -void CLG_(init_eventsets)() +void CLG_(init_eventsets)(void) { // Event groups from which the event sets are composed // the "Use" group only is used with "cacheuse" simulation diff --git a/callgrind/threads.c b/callgrind/threads.c index 20b23c1899..624588a269 100644 --- a/callgrind/threads.c +++ b/callgrind/threads.c @@ -61,17 +61,17 @@ ThreadId CLG_(current_tid); static thread_info** thread; -thread_info** CLG_(get_threads)() +thread_info** CLG_(get_threads)(void) { return thread; } -thread_info* CLG_(get_current_thread)() +thread_info* CLG_(get_current_thread)(void) { return thread[CLG_(current_tid)]; } -void CLG_(init_threads)() +void CLG_(init_threads)(void) { UInt i; @@ -224,7 +224,7 @@ void CLG_(pre_signal)(ThreadId tid, Int sigNum, Bool alt_stack) * * Called from CLG_(pop_call_stack) */ -void CLG_(run_post_signal_on_call_stack_bottom)() +void CLG_(run_post_signal_on_call_stack_bottom)(void) { exec_state* es = top_exec_state(); CLG_ASSERT(es != 0); diff --git a/coregrind/m_debuginfo/readpdb.c b/coregrind/m_debuginfo/readpdb.c index 7c5467d379..414c185ccd 100644 --- a/coregrind/m_debuginfo/readpdb.c +++ b/coregrind/m_debuginfo/readpdb.c @@ -1554,7 +1554,6 @@ static ULong DEBUG_SnarfLinetab( */ pnt.c = linetab; nfile = *pnt.s++; - nseg = *pnt.s++; filetab = pnt.ui; diff --git a/coregrind/m_gdbserver/target.c b/coregrind/m_gdbserver/target.c index 490276b6c4..f9f32f4aa5 100644 --- a/coregrind/m_gdbserver/target.c +++ b/coregrind/m_gdbserver/target.c @@ -190,7 +190,7 @@ Int valgrind_stopped_by_syscall (void) return sysno_to_report; } -Bool valgrind_stopped_before_syscall() +Bool valgrind_stopped_before_syscall(void) { vg_assert (sysno_to_report >= 0); return before_syscall; diff --git a/drd/drd_bitmap.c b/drd/drd_bitmap.c index 479c7f20e3..3bd7fa56bd 100644 --- a/drd/drd_bitmap.c +++ b/drd/drd_bitmap.c @@ -64,7 +64,7 @@ void DRD_(bm_module_cleanup)(void) s_bm2_set_template = NULL; } -struct bitmap* DRD_(bm_new)() +struct bitmap* DRD_(bm_new)(void) { struct bitmap* bm; diff --git a/drd/drd_load_store.c b/drd/drd_load_store.c index fba1dac713..80d326a0e2 100644 --- a/drd/drd_load_store.c +++ b/drd/drd_load_store.c @@ -66,7 +66,7 @@ static Bool s_first_race_only = False; /* Function definitions. */ -Bool DRD_(get_check_stack_accesses)() +Bool DRD_(get_check_stack_accesses)(void) { return s_check_stack_accesses; } @@ -77,7 +77,7 @@ void DRD_(set_check_stack_accesses)(const Bool c) s_check_stack_accesses = c; } -Bool DRD_(get_first_race_only)() +Bool DRD_(get_first_race_only)(void) { return s_first_race_only; } diff --git a/drd/drd_thread.c b/drd/drd_thread.c index 32064c3b15..891967b039 100644 --- a/drd/drd_thread.c +++ b/drd/drd_thread.c @@ -1681,7 +1681,7 @@ ULong DRD_(thread_get_discard_ordered_segments_count)(void) } /** Return how many times the conflict set has been updated entirely. */ -ULong DRD_(thread_get_compute_conflict_set_count)() +ULong DRD_(thread_get_compute_conflict_set_count)(void) { return s_compute_conflict_set_count; } diff --git a/drd/drd_vc.c b/drd/drd_vc.c index ee9fa52bea..5705391f27 100644 --- a/drd/drd_vc.c +++ b/drd/drd_vc.c @@ -67,10 +67,10 @@ void DRD_(vc_cleanup)(VectorClock* const vc) DRD_(vc_reserve)(vc, 0); } -/** Copy constructor -- initializes *new. */ -void DRD_(vc_copy)(VectorClock* const new, const VectorClock* const rhs) +/** Copy constructor -- initializes *obj. */ +void DRD_(vc_copy)(VectorClock* const obj, const VectorClock* const rhs) { - DRD_(vc_init)(new, rhs->vc, rhs->size); + DRD_(vc_init)(obj, rhs->vc, rhs->size); } /** Assignment operator -- *lhs is already a valid vector clock. */ diff --git a/drd/drd_vc.h b/drd/drd_vc.h index 47dd51baf6..0161be0f23 100644 --- a/drd/drd_vc.h +++ b/drd/drd_vc.h @@ -72,7 +72,7 @@ void DRD_(vc_init)(VectorClock* const vc, const VCElem* const vcelem, const unsigned size); void DRD_(vc_cleanup)(VectorClock* const vc); -void DRD_(vc_copy)(VectorClock* const new, const VectorClock* const rhs); +void DRD_(vc_copy)(VectorClock* const obj, const VectorClock* const rhs); void DRD_(vc_assign)(VectorClock* const lhs, const VectorClock* const rhs); void DRD_(vc_increment)(VectorClock* const vc, DrdThreadId const tid); static __inline__