From ea1fb768ecfca099d9ee84068d77c3ecf0a78dd4 Mon Sep 17 00:00:00 2001
From: Bryan Richter <bryan@haskell.foundation>
Date: Fri, 30 Jun 2023 09:11:31 +0300
Subject: [PATCH] Add missing void prototypes to rts functions

See #23561.

(cherry picked from commit 82ac6bf113526f61913943b911089534705984fb)
---
 rts/CheckUnload.c               |  8 ++++----
 rts/ExecPage.c                  |  2 +-
 rts/ForeignExports.c            |  4 ++--
 rts/IPE.c                       |  2 +-
 rts/Libdw.c                     |  2 +-
 rts/Linker.c                    |  2 +-
 rts/OldARMAtomic.c              |  4 ++--
 rts/Printer.c                   |  4 ++--
 rts/ReportMemoryMap.c           |  6 +++---
 rts/RtsAPI.c                    |  2 +-
 rts/RtsMessages.c               |  6 +++---
 rts/Schedule.c                  |  2 +-
 rts/StaticPtrTable.c            |  4 ++--
 rts/Stats.c                     | 14 +++++++-------
 rts/Ticky.c                     |  4 ++--
 rts/Trace.c                     | 12 ++++++------
 rts/adjustor/LibffiAdjustor.c   |  2 +-
 rts/adjustor/NativeAmd64.c      |  2 +-
 rts/adjustor/NativeAmd64Mingw.c |  2 +-
 rts/adjustor/NativeIA64.c       |  2 +-
 rts/adjustor/NativePowerPC.c    |  2 +-
 rts/adjustor/Nativei386.c       |  2 +-
 rts/eventlog/EventLog.c         |  4 ++--
 rts/linker/PEi386.c             |  4 ++--
 rts/posix/GetTime.c             |  2 +-
 rts/sm/BlockAlloc.c             |  4 ++--
 rts/sm/GC.c                     |  2 +-
 rts/sm/NonMoving.c              |  2 +-
 rts/sm/NonMovingCensus.c        |  2 +-
 rts/sm/NonMovingMark.c          |  6 +++---
 rts/sm/NonMovingSweep.c         | 10 +++++-----
 rts/wasm/GetTime.c              |  2 +-
 rts/win32/AsyncMIO.c            |  2 +-
 rts/win32/AsyncWinIO.c          |  2 +-
 rts/win32/ConsoleHandler.c      |  2 +-
 rts/win32/GetTime.c             |  4 ++--
 rts/win32/OSThreads.c           |  6 +++---
 rts/win32/WorkQueue.c           |  2 +-
 38 files changed, 73 insertions(+), 73 deletions(-)

diff --git a/rts/CheckUnload.c b/rts/CheckUnload.c
index 3761fd2bf5c..3140b571b83 100644
--- a/rts/CheckUnload.c
+++ b/rts/CheckUnload.c
@@ -186,12 +186,12 @@ static void freeOCSectionIndices(OCSectionIndices *s_indices)
     stgFree(s_indices);
 }
 
-void initUnloadCheck()
+void initUnloadCheck(void)
 {
     global_s_indices = createOCSectionIndices();
 }
 
-void exitUnloadCheck()
+void exitUnloadCheck(void)
 {
     freeOCSectionIndices(global_s_indices);
     global_s_indices = NULL;
@@ -436,7 +436,7 @@ void markObjectCode(const void *addr)
 
 // Returns whether or not the GC that follows needs to mark code for potential
 // unloading.
-bool prepareUnloadCheck()
+bool prepareUnloadCheck(void)
 {
     if (global_s_indices == NULL) {
         return false;
@@ -453,7 +453,7 @@ bool prepareUnloadCheck()
     return true;
 }
 
-void checkUnload()
+void checkUnload(void)
 {
     if (global_s_indices == NULL) {
         return;
diff --git a/rts/ExecPage.c b/rts/ExecPage.c
index 0f83c8e1f59..add135252b6 100644
--- a/rts/ExecPage.c
+++ b/rts/ExecPage.c
@@ -9,7 +9,7 @@
 #include "sm/OSMem.h"
 #include "linker/MMap.h"
 
-ExecPage *allocateExecPage() {
+ExecPage *allocateExecPage(void) {
     ExecPage *page = (ExecPage *) mmapAnonForLinker(getPageSize());
     return page;
 }
diff --git a/rts/ForeignExports.c b/rts/ForeignExports.c
index e4d7d9a39a0..24e8e988612 100644
--- a/rts/ForeignExports.c
+++ b/rts/ForeignExports.c
@@ -83,7 +83,7 @@ void foreignExportsLoadingObject(ObjectCode *oc)
     loading_obj = oc;
 }
 
-void foreignExportsFinishedLoadingObject()
+void foreignExportsFinishedLoadingObject(void)
 {
     ASSERT(loading_obj != NULL);
     loading_obj = NULL;
@@ -92,7 +92,7 @@ void foreignExportsFinishedLoadingObject()
 
 /* Caller must own linker_mutex so that we can safely modify
  * oc->stable_ptrs. */
-void processForeignExports()
+void processForeignExports(void)
 {
     while (pending) {
         struct ForeignExportsList *cur = pending;
diff --git a/rts/IPE.c b/rts/IPE.c
index 3c12e3c92ae..0fbbfd1b5d4 100644
--- a/rts/IPE.c
+++ b/rts/IPE.c
@@ -173,7 +173,7 @@ InfoProvEnt *lookupIPE(const StgInfoTable *info) {
     return lookupHashTable(ipeMap, (StgWord)info);
 }
 
-void updateIpeMap() {
+void updateIpeMap(void) {
     // Check if there's any work at all. If not so, we can circumvent locking,
     // which decreases performance.
     IpeBufferListNode *pending = xchg_ptr((void **) &ipeBufferList, NULL);
diff --git a/rts/Libdw.c b/rts/Libdw.c
index 3243979fd35..e1689c3ac4f 100644
--- a/rts/Libdw.c
+++ b/rts/Libdw.c
@@ -75,7 +75,7 @@ void libdwFree(LibdwSession *session) {
 }
 
 // Create a libdw session with DWARF information for all loaded modules
-LibdwSession *libdwInit() {
+LibdwSession *libdwInit(void) {
     LibdwSession *session = stgCallocBytes(1, sizeof(LibdwSession),
                                            "libdwInit");
     // Initialize ELF library
diff --git a/rts/Linker.c b/rts/Linker.c
index 7eb04097090..152f6f9281c 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -1032,7 +1032,7 @@ SymbolAddr* loadSymbol(SymbolName *lbl, RtsSymbolInfo *pinfo) {
 }
 
 void
-printLoadedObjects() {
+printLoadedObjects(void) {
     ObjectCode* oc;
     for (oc = objects; oc; oc = oc->next) {
         if (oc->sections != NULL) {
diff --git a/rts/OldARMAtomic.c b/rts/OldARMAtomic.c
index deac848eba2..5166319a661 100644
--- a/rts/OldARMAtomic.c
+++ b/rts/OldARMAtomic.c
@@ -39,7 +39,7 @@ static int arm_atomic_spin_trylock (void)
     return -1;
 }
 
-void arm_atomic_spin_lock()
+void arm_atomic_spin_lock(void)
 {
   while (arm_atomic_spin_trylock())
 #if defined(HAVE_SCHED_H)
@@ -49,7 +49,7 @@ void arm_atomic_spin_lock()
 #endif
 }
 
-void arm_atomic_spin_unlock()
+void arm_atomic_spin_unlock(void)
 {
   atomic_spin = 0;
 }
diff --git a/rts/Printer.c b/rts/Printer.c
index 85e3069967d..a84d933879f 100644
--- a/rts/Printer.c
+++ b/rts/Printer.c
@@ -759,7 +759,7 @@ void printStaticObjects( StgClosure *p )
     }
 }
 
-void printWeakLists()
+void printWeakLists(void)
 {
     debugBelch("======= WEAK LISTS =======\n");
 
@@ -786,7 +786,7 @@ void printWeakLists()
     debugBelch("=========================\n");
 }
 
-void printLargeAndPinnedObjects()
+void printLargeAndPinnedObjects(void)
 {
     debugBelch("====== PINNED OBJECTS ======\n");
 
diff --git a/rts/ReportMemoryMap.c b/rts/ReportMemoryMap.c
index c5e7a92c4d1..446ee8862ae 100644
--- a/rts/ReportMemoryMap.c
+++ b/rts/ReportMemoryMap.c
@@ -25,7 +25,7 @@
 
 #if defined(mingw32_HOST_OS)
 
-void reportMemoryMap() {
+void reportMemoryMap(void) {
     debugBelch("\nMemory map:\n");
     uint8_t *addr = NULL;
     while (true) {
@@ -74,7 +74,7 @@ void reportMemoryMap() {
 
 #elif defined(darwin_HOST_OS)
 
-void reportMemoryMap() {
+void reportMemoryMap(void) {
     // Inspired by MacFUSE /proc implementation
     debugBelch("\nMemory map:\n");
     while (true) {
@@ -112,7 +112,7 @@ void reportMemoryMap() {
 #else
 
 // Linux et al.
-void reportMemoryMap() {
+void reportMemoryMap(void) {
     debugBelch("\nMemory map:\n");
     FILE *f = fopen("/proc/self/maps", "r");
     if (f == NULL) {
diff --git a/rts/RtsAPI.c b/rts/RtsAPI.c
index 1d046afbbd5..c5fd84ee316 100644
--- a/rts/RtsAPI.c
+++ b/rts/RtsAPI.c
@@ -893,7 +893,7 @@ rts_resume (PauseToken *pauseToken STG_UNUSED)
     stg_exit(EXIT_FAILURE);
 }
 
-bool rts_isPaused()
+bool rts_isPaused(void)
 {
     errorBelch("Warning: Pausing/Resuming the RTS is only possible for "
                "multithreaded RTS.");
diff --git a/rts/RtsMessages.c b/rts/RtsMessages.c
index d760bd233cf..6d8a524c4c9 100644
--- a/rts/RtsMessages.c
+++ b/rts/RtsMessages.c
@@ -330,7 +330,7 @@ rtsDebugMsgFn(const char *s, va_list ap)
 void rtsBadAlignmentBarf(void) STG_NORETURN;
 
 void
-rtsBadAlignmentBarf()
+rtsBadAlignmentBarf(void)
 {
     barf("Encountered incorrectly aligned pointer. This can't be good.");
 }
@@ -339,7 +339,7 @@ rtsBadAlignmentBarf()
 void rtsOutOfBoundsAccess(void) STG_NORETURN;
 
 void
-rtsOutOfBoundsAccess()
+rtsOutOfBoundsAccess(void)
 {
     barf("Encountered out of bounds array access.");
 }
@@ -348,7 +348,7 @@ rtsOutOfBoundsAccess()
 void rtsMemcpyRangeOverlap(void) STG_NORETURN;
 
 void
-rtsMemcpyRangeOverlap()
+rtsMemcpyRangeOverlap(void)
 {
     barf("Encountered overlapping source/destination ranges in a memcpy-using op.");
 }
diff --git a/rts/Schedule.c b/rts/Schedule.c
index 685862a08ba..86e5e2a97b6 100644
--- a/rts/Schedule.c
+++ b/rts/Schedule.c
@@ -2384,7 +2384,7 @@ setNumCapabilities (uint32_t new_n_capabilities USED_IF_THREADS)
  * ------------------------------------------------------------------------- */
 
 static void
-deleteAllThreads ()
+deleteAllThreads (void)
 {
     // NOTE: only safe to call if we own all capabilities.
 
diff --git a/rts/StaticPtrTable.c b/rts/StaticPtrTable.c
index 282d9b78999..b3db8f72ff9 100644
--- a/rts/StaticPtrTable.c
+++ b/rts/StaticPtrTable.c
@@ -99,11 +99,11 @@ int hs_spt_keys(StgPtr keys[], int szKeys) {
     return 0;
 }
 
-int hs_spt_key_count() {
+int hs_spt_key_count(void) {
   return spt ? keyCountHashTable(spt) : 0;
 }
 
-void exitStaticPtrTable() {
+void exitStaticPtrTable(void) {
   if (spt) {
     freeHashTable(spt, freeSptEntry);
     spt = NULL;
diff --git a/rts/Stats.c b/rts/Stats.c
index a2701bd0c81..e60c0f2ac38 100644
--- a/rts/Stats.c
+++ b/rts/Stats.c
@@ -222,7 +222,7 @@ initStats1 (void)
 }
 
 void
-initGenerationStats()
+initGenerationStats(void)
 {
     for (uint32_t i = 0; i < RtsFlags.GcFlags.generations; i++) {
         GC_coll_cpu[i] = 0;
@@ -235,7 +235,7 @@ initGenerationStats()
    Reset stats of child process after fork()
    ------------------------------------------------------------------------ */
 
-void resetChildProcessStats()
+void resetChildProcessStats(void)
 {
     initStats0();
     initGenerationStats();
@@ -295,7 +295,7 @@ stat_startGCSync (gc_thread *gct)
 }
 
 void
-stat_startNonmovingGc ()
+stat_startNonmovingGc (void)
 {
     ACQUIRE_LOCK(&stats_mutex);
     start_nonmoving_gc_cpu = getCurrentThreadCPUTime();
@@ -304,7 +304,7 @@ stat_startNonmovingGc ()
 }
 
 void
-stat_endNonmovingGc ()
+stat_endNonmovingGc (void)
 {
     Time cpu = getCurrentThreadCPUTime();
     Time elapsed = getProcessElapsedTime();
@@ -323,7 +323,7 @@ stat_endNonmovingGc ()
 }
 
 void
-stat_startNonmovingGcSync ()
+stat_startNonmovingGcSync (void)
 {
     ACQUIRE_LOCK(&stats_mutex);
     start_nonmoving_gc_sync_elapsed = getProcessElapsedTime();
@@ -332,7 +332,7 @@ stat_startNonmovingGcSync ()
 }
 
 void
-stat_endNonmovingGcSync ()
+stat_endNonmovingGcSync (void)
 {
     Time end_elapsed = getProcessElapsedTime();
     ACQUIRE_LOCK(&stats_mutex);
@@ -1469,7 +1469,7 @@ stat_exitReport (void)
     RELEASE_LOCK(&all_tasks_mutex);
 }
 
-void stat_exit()
+void stat_exit(void)
 {
 #if defined(THREADED_RTS)
         closeMutex(&stats_mutex);
diff --git a/rts/Ticky.c b/rts/Ticky.c
index e6a2787b7ca..65d52c67081 100644
--- a/rts/Ticky.c
+++ b/rts/Ticky.c
@@ -403,14 +403,14 @@ printRegisteredCounterInfo (FILE *tf)
     }
 }
 
-void emitTickyCounterDefs()
+void emitTickyCounterDefs(void)
 {
 #if defined(TRACING)
     postTickyCounterDefs(ticky_entry_ctrs);
 #endif
 }
 
-void emitTickyCounterSamples()
+void emitTickyCounterSamples(void)
 {
 #if defined(TRACING)
     postTickyCounterSamples(ticky_entry_ctrs);
diff --git a/rts/Trace.c b/rts/Trace.c
index 77e3bf0bd99..68f82fff81e 100644
--- a/rts/Trace.c
+++ b/rts/Trace.c
@@ -136,7 +136,7 @@ void resetTracing (void)
     restartEventLogging();
 }
 
-void flushTrace ()
+void flushTrace (void)
 {
     if (eventlog_enabled) {
         flushEventLog(NULL);
@@ -876,7 +876,7 @@ void traceThreadLabel_(Capability *cap,
     }
 }
 
-void traceConcMarkBegin()
+void traceConcMarkBegin(void)
 {
     if (eventlog_enabled)
         postEventNoCap(EVENT_CONC_MARK_BEGIN);
@@ -888,25 +888,25 @@ void traceConcMarkEnd(StgWord32 marked_obj_count)
         postConcMarkEnd(marked_obj_count);
 }
 
-void traceConcSyncBegin()
+void traceConcSyncBegin(void)
 {
     if (eventlog_enabled)
         postEventNoCap(EVENT_CONC_SYNC_BEGIN);
 }
 
-void traceConcSyncEnd()
+void traceConcSyncEnd(void)
 {
     if (eventlog_enabled)
         postEventNoCap(EVENT_CONC_SYNC_END);
 }
 
-void traceConcSweepBegin()
+void traceConcSweepBegin(void)
 {
     if (eventlog_enabled)
         postEventNoCap(EVENT_CONC_SWEEP_BEGIN);
 }
 
-void traceConcSweepEnd()
+void traceConcSweepEnd(void)
 {
     if (eventlog_enabled)
         postEventNoCap(EVENT_CONC_SWEEP_END);
diff --git a/rts/adjustor/LibffiAdjustor.c b/rts/adjustor/LibffiAdjustor.c
index 88b2df2a91a..203b3ab0c87 100644
--- a/rts/adjustor/LibffiAdjustor.c
+++ b/rts/adjustor/LibffiAdjustor.c
@@ -31,7 +31,7 @@ static ffi_status ffi_alloc_prep_closure(ffi_closure **pclosure, ffi_cif *cif,
 /* Maps AdjustorExecutable* to AdjustorWritable*. */
 static HashTable* allocatedExecs;
 
-void initAdjustors() {
+void initAdjustors(void) {
     allocatedExecs = allocHashTable();
 }
 
diff --git a/rts/adjustor/NativeAmd64.c b/rts/adjustor/NativeAmd64.c
index 33b87e32f09..086a8533622 100644
--- a/rts/adjustor/NativeAmd64.c
+++ b/rts/adjustor/NativeAmd64.c
@@ -28,7 +28,7 @@ static struct AdjustorPool *simple_ccall_pool;
 DECLARE_ADJUSTOR_TEMPLATE(complex_ccall);
 static struct AdjustorPool *complex_ccall_pool;
 
-void initAdjustors()
+void initAdjustors(void)
 {
     simple_ccall_pool = new_adjustor_pool_from_template(&simple_ccall_adjustor_template);
     complex_ccall_pool = new_adjustor_pool_from_template(&complex_ccall_adjustor_template);
diff --git a/rts/adjustor/NativeAmd64Mingw.c b/rts/adjustor/NativeAmd64Mingw.c
index 8d18d3a833c..4e3c305d66c 100644
--- a/rts/adjustor/NativeAmd64Mingw.c
+++ b/rts/adjustor/NativeAmd64Mingw.c
@@ -34,7 +34,7 @@ static struct AdjustorPool *complex_float_ccall_pool;
 DECLARE_ADJUSTOR_TEMPLATE(complex_nofloat_ccall);
 static struct AdjustorPool *complex_nofloat_ccall_pool;
 
-void initAdjustors()
+void initAdjustors(void)
 {
     simple_ccall_pool = new_adjustor_pool_from_template(&simple_ccall_adjustor_template);
     complex_float_ccall_pool = new_adjustor_pool_from_template(&complex_float_ccall_adjustor_template);
diff --git a/rts/adjustor/NativeIA64.c b/rts/adjustor/NativeIA64.c
index f9556249453..2fe40ce5667 100644
--- a/rts/adjustor/NativeIA64.c
+++ b/rts/adjustor/NativeIA64.c
@@ -35,7 +35,7 @@ stgAllocStable(size_t size_in_bytes, StgStablePtr *stable)
     return(&(arr->payload));
 }
 
-void initAdjustors() { }
+void initAdjustors(void) { }
 
 void*
 createAdjustor(int cconv, StgStablePtr hptr,
diff --git a/rts/adjustor/NativePowerPC.c b/rts/adjustor/NativePowerPC.c
index 5abb27533a8..6cc4093d63e 100644
--- a/rts/adjustor/NativePowerPC.c
+++ b/rts/adjustor/NativePowerPC.c
@@ -53,7 +53,7 @@ typedef struct AdjustorStub {
 #endif /* !(defined(powerpc_HOST_ARCH) && defined(linux_HOST_OS)) */
 #endif /* defined(powerpc_HOST_ARCH) || defined(powerpc64_HOST_ARCH) */
 
-void initAdjustors() { }
+void initAdjustors(void) { }
 
 void*
 createAdjustor(int cconv, StgStablePtr hptr,
diff --git a/rts/adjustor/Nativei386.c b/rts/adjustor/Nativei386.c
index 71143b00d39..22db4fa4ca1 100644
--- a/rts/adjustor/Nativei386.c
+++ b/rts/adjustor/Nativei386.c
@@ -92,7 +92,7 @@ static void mk_stdcall_adjustor(uint8_t *code, const void *context, void *user_d
 static struct AdjustorPool *stdcall_pool;
 #endif
 
-void initAdjustors() {
+void initAdjustors(void) {
     ccall_pool = new_adjustor_pool(sizeof(struct CCallContext), CCALL_ADJUSTOR_LEN, mk_ccall_adjustor, NULL);
 #if !defined(darwin_HOST_OS)
     stdcall_pool = new_adjustor_pool(sizeof(struct AdjustorContext), STDCALL_ADJUSTOR_LEN, mk_stdcall_adjustor, NULL);
diff --git a/rts/eventlog/EventLog.c b/rts/eventlog/EventLog.c
index d6b41c43784..476888615cb 100644
--- a/rts/eventlog/EventLog.c
+++ b/rts/eventlog/EventLog.c
@@ -359,7 +359,7 @@ get_n_capabilities(void)
 }
 
 void
-initEventLogging()
+initEventLogging(void)
 {
     /*
      * Allocate buffer(s) to store events.
@@ -1561,7 +1561,7 @@ void flushLocalEventsBuf(Capability *cap)
 
 // Flush all capabilities' event buffers when we already hold all capabilities.
 // Used during forkProcess.
-void flushAllCapsEventsBufs()
+void flushAllCapsEventsBufs(void)
 {
     if (!event_log_writer) {
         return;
diff --git a/rts/linker/PEi386.c b/rts/linker/PEi386.c
index b5134235b02..e404abc85cc 100644
--- a/rts/linker/PEi386.c
+++ b/rts/linker/PEi386.c
@@ -433,7 +433,7 @@ const int default_alignment = 8;
    the pointer as a redirect.  Essentially it's a DATA DLL reference.  */
 const void* __rts_iob_func = (void*)&__acrt_iob_func;
 
-void initLinker_PEi386()
+void initLinker_PEi386(void)
 {
     if (!ghciInsertSymbolTable(WSTR("(GHCi/Ld special symbols)"),
                                symhash, "__image_base__",
@@ -452,7 +452,7 @@ void initLinker_PEi386()
   atexit (exitLinker_PEi386);
 }
 
-void exitLinker_PEi386()
+void exitLinker_PEi386(void)
 {
 }
 
diff --git a/rts/posix/GetTime.c b/rts/posix/GetTime.c
index 7588236ce50..500f5e717aa 100644
--- a/rts/posix/GetTime.c
+++ b/rts/posix/GetTime.c
@@ -45,7 +45,7 @@ static uint64_t timer_scaling_factor_numer = 0;
 static uint64_t timer_scaling_factor_denom = 0;
 #endif
 
-void initializeTimer()
+void initializeTimer(void)
 {
 #if defined(darwin_HOST_OS)
     mach_timebase_info_data_t info;
diff --git a/rts/sm/BlockAlloc.c b/rts/sm/BlockAlloc.c
index 7f78bac04a7..3fb8afcd073 100644
--- a/rts/sm/BlockAlloc.c
+++ b/rts/sm/BlockAlloc.c
@@ -1138,14 +1138,14 @@ static void sortDeferredList(bdescr** head) {
     }
 }
 
-void deferMBlockFreeing() {
+void deferMBlockFreeing(void) {
     if(defer_mblock_frees) {
         barf("MBlock freeing is already deferred");
     }
     defer_mblock_frees = true;
 }
 
-void commitMBlockFreeing() {
+void commitMBlockFreeing(void) {
     if(! defer_mblock_frees) {
         barf("MBlock freeing was never deferred");
     }
diff --git a/rts/sm/GC.c b/rts/sm/GC.c
index 798a86c0baf..7fbcec0038b 100644
--- a/rts/sm/GC.c
+++ b/rts/sm/GC.c
@@ -184,7 +184,7 @@ uint32_t n_gc_threads;
 static uint32_t n_gc_idle_threads;
 bool work_stealing;
 
-static bool is_par_gc() {
+static bool is_par_gc(void) {
 #if defined(THREADED_RTS)
     if(n_gc_threads == 1) { return false; }
     ASSERT(n_gc_threads > n_gc_idle_threads);
diff --git a/rts/sm/NonMoving.c b/rts/sm/NonMoving.c
index 66cc512c12a..018d7d76d9c 100644
--- a/rts/sm/NonMoving.c
+++ b/rts/sm/NonMoving.c
@@ -1338,7 +1338,7 @@ void locate_object(P_ obj)
 #endif
 }
 
-void nonmovingPrintSweepList()
+void nonmovingPrintSweepList(void)
 {
     debugBelch("==== SWEEP LIST =====\n");
     int i = 0;
diff --git a/rts/sm/NonMovingCensus.c b/rts/sm/NonMovingCensus.c
index 27494284fe4..8edf692f887 100644
--- a/rts/sm/NonMovingCensus.c
+++ b/rts/sm/NonMovingCensus.c
@@ -141,7 +141,7 @@ void nonmovingPrintAllocatorCensus(bool collect_live_words)
     }
 }
 
-void nonmovingTraceAllocatorCensus()
+void nonmovingTraceAllocatorCensus(void)
 {
 #if defined(TRACING)
     if (!RtsFlags.GcFlags.useNonmoving && !TRACE_nonmoving_gc)
diff --git a/rts/sm/NonMovingMark.c b/rts/sm/NonMovingMark.c
index af2bce354db..6ca963ec1de 100644
--- a/rts/sm/NonMovingMark.c
+++ b/rts/sm/NonMovingMark.c
@@ -260,7 +260,7 @@ StgWord nonmoving_write_barrier_enabled = false;
 MarkQueue *current_mark_queue = NULL;
 
 /* Initialise update remembered set data structures */
-void nonmovingMarkInit() {
+void nonmovingMarkInit(void) {
 #if defined(THREADED_RTS)
     initMutex(&upd_rem_set_lock);
     initCondition(&upd_rem_set_flushed_cond);
@@ -367,7 +367,7 @@ void nonmovingBeginFlush(Task *task)
 /* Wait until a capability has flushed its update remembered set. Returns true
  * if all capabilities have flushed.
  */
-bool nonmovingWaitForFlush()
+bool nonmovingWaitForFlush(void)
 {
     ACQUIRE_LOCK(&upd_rem_set_lock);
     debugTrace(DEBUG_nonmoving_gc, "Flush count %d", upd_rem_set_flush_count);
@@ -2062,7 +2062,7 @@ void nonmovingMarkDeadWeaks (struct MarkQueue_ *queue, StgWeak **dead_weaks)
 }
 
 // Non-moving heap variant of `tidyThreadList`
-void nonmovingTidyThreads ()
+void nonmovingTidyThreads (void)
 {
     StgTSO *next;
     StgTSO **prev = &nonmoving_old_threads;
diff --git a/rts/sm/NonMovingSweep.c b/rts/sm/NonMovingSweep.c
index 381a66e9b57..4f634e71a18 100644
--- a/rts/sm/NonMovingSweep.c
+++ b/rts/sm/NonMovingSweep.c
@@ -74,7 +74,7 @@ nonmovingSweepSegment(struct NonmovingSegment *seg)
 
 #if defined(DEBUG)
 
-void nonmovingGcCafs()
+void nonmovingGcCafs(void)
 {
     uint32_t i = 0;
     StgIndStatic *next;
@@ -279,7 +279,7 @@ dirty_BLOCKING_QUEUE:
 }
 
 /* N.B. This happens during the pause so we own all capabilities. */
-void nonmovingSweepMutLists()
+void nonmovingSweepMutLists(void)
 {
     for (uint32_t n = 0; n < getNumCapabilities(); n++) {
         Capability *cap = getCapability(n);
@@ -324,7 +324,7 @@ static void freeChain_lock_max(bdescr *bd, int max_dur)
   RELEASE_SM_LOCK;
 }
 
-void nonmovingSweepLargeObjects()
+void nonmovingSweepLargeObjects(void)
 {
     freeChain_lock_max(nonmoving_large_objects, 10000);
     nonmoving_large_objects = nonmoving_marked_large_objects;
@@ -333,7 +333,7 @@ void nonmovingSweepLargeObjects()
     n_nonmoving_marked_large_blocks = 0;
 }
 
-void nonmovingSweepCompactObjects()
+void nonmovingSweepCompactObjects(void)
 {
     bdescr *next;
     ACQUIRE_SM_LOCK;
@@ -367,7 +367,7 @@ static bool is_alive(StgClosure *p)
     }
 }
 
-void nonmovingSweepStableNameTable()
+void nonmovingSweepStableNameTable(void)
 {
     // See comments in gcStableTables
 
diff --git a/rts/wasm/GetTime.c b/rts/wasm/GetTime.c
index 3e9e304f39c..a57ba128ee4 100644
--- a/rts/wasm/GetTime.c
+++ b/rts/wasm/GetTime.c
@@ -15,7 +15,7 @@
 #include <time.h>
 #include <sys/time.h>
 
-void initializeTimer()
+void initializeTimer(void)
 {
 }
 
diff --git a/rts/win32/AsyncMIO.c b/rts/win32/AsyncMIO.c
index 00d1638d634..32465d682a5 100644
--- a/rts/win32/AsyncMIO.c
+++ b/rts/win32/AsyncMIO.c
@@ -150,7 +150,7 @@ addDoProcRequest(void* proc, void* param)
 
 
 int
-startupAsyncIO()
+startupAsyncIO(void)
 {
     if (!StartIOManager()) {
         return 0;
diff --git a/rts/win32/AsyncWinIO.c b/rts/win32/AsyncWinIO.c
index 2c97ab56351..71a8c158b28 100644
--- a/rts/win32/AsyncWinIO.c
+++ b/rts/win32/AsyncWinIO.c
@@ -435,7 +435,7 @@ static void notifyScheduler(uint32_t num) {
     processRemoteCompletion queued.
     IO runner thread blocked until processRemoteCompletion has run.
     */
-bool queueIOThread()
+bool queueIOThread(void)
 {
   bool result = false;
 #if !defined(THREADED_RTS)
diff --git a/rts/win32/ConsoleHandler.c b/rts/win32/ConsoleHandler.c
index a7940a60c0c..c54a798ccfc 100644
--- a/rts/win32/ConsoleHandler.c
+++ b/rts/win32/ConsoleHandler.c
@@ -332,7 +332,7 @@ rts_ConsoleHandlerDone (int ev USED_IF_NOT_THREADS)
  * up as part Ctrl-C delivery.
  */
 int
-rts_waitConsoleHandlerCompletion()
+rts_waitConsoleHandlerCompletion(void)
 {
     /* As long as the worker doesn't need to do a multiple wait,
      * let's keep this HANDLE private to this 'module'.
diff --git a/rts/win32/GetTime.c b/rts/win32/GetTime.c
index 1722e14f8f2..e401f8c571d 100644
--- a/rts/win32/GetTime.c
+++ b/rts/win32/GetTime.c
@@ -66,7 +66,7 @@ static LARGE_INTEGER qpc_frequency = {.QuadPart = 0};
 // Initialize qpc_frequency. This function should be called before any call to
 // getMonotonicNSec.  If QPC is not supported on this system, qpc_frequency is
 // set to 0.
-void initializeTimer()
+void initializeTimer(void)
 {
     BOOL qpc_supported = QueryPerformanceFrequency(&qpc_frequency);
     if (!qpc_supported)
@@ -76,7 +76,7 @@ void initializeTimer()
 }
 
 HsWord64
-getMonotonicNSec()
+getMonotonicNSec(void)
 {
     if (qpc_frequency.QuadPart)
     {
diff --git a/rts/win32/OSThreads.c b/rts/win32/OSThreads.c
index f02a58d0ed1..2d2c59fa308 100644
--- a/rts/win32/OSThreads.c
+++ b/rts/win32/OSThreads.c
@@ -28,14 +28,14 @@ static uint32_t* cpuGroupCumulativeCache = NULL;
 static uint8_t* cpuGroupDistCache = NULL;
 
 void
-yieldThread()
+yieldThread(void)
 {
   SwitchToThread();
   return;
 }
 
 void
-shutdownThread()
+shutdownThread(void)
 {
     ExitThread(0);
     barf("ExitThread() returned"); // avoid gcc warning
@@ -65,7 +65,7 @@ createOSThread (OSThreadId* pId, const char *name STG_UNUSED,
 }
 
 OSThreadId
-osThreadId()
+osThreadId(void)
 {
   return GetCurrentThreadId();
 }
diff --git a/rts/win32/WorkQueue.c b/rts/win32/WorkQueue.c
index 1d2e9c7a41c..c5ffc96d571 100644
--- a/rts/win32/WorkQueue.c
+++ b/rts/win32/WorkQueue.c
@@ -40,7 +40,7 @@ newSemaphore(int initCount, int max)
  *
  */
 WorkQueue*
-NewWorkQueue()
+NewWorkQueue(void)
 {
   WorkQueue* wq = (WorkQueue*)stgMallocBytes(sizeof(WorkQueue), "NewWorkQueue");
 
-- 
GitLab