build: Fix missing void parameters in C

Add missing void parameters to several functions. This prepares the code
to apply the -Wstrict-prototypes warning.

Bug: 329
Change-Id: Id5b152e9f8d77d07e99a6e781b3a3c4ef9bd08c0
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/35560
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
diff --git a/pw_assert/assert_backend_compile_test_c.c b/pw_assert/assert_backend_compile_test_c.c
index c602f37..a4aaced 100644
--- a/pw_assert/assert_backend_compile_test_c.c
+++ b/pw_assert/assert_backend_compile_test_c.c
@@ -25,7 +25,7 @@
 
 #include "pw_assert/assert.h"
 
-static void EnsureNullIsIncluded() {
+static void EnsureNullIsIncluded(void) {
   // This is a compile check to ensure NULL is defined. It comes before the
   // status.h include to ensure we don't accidentally get NULL from status.h.
   PW_CHECK_NOTNULL(0xa);
@@ -64,7 +64,7 @@
 
 static int Add3(int a, int b, int c) { return a + b + c; }
 
-void AssertBackendCompileTestsInC() {
+void AssertBackendCompileTestsInC(void) {
   {  // TEST(Crash, WithAndWithoutMessageArguments)
     MAYBE_SKIP_TEST;
     PW_CRASH(FAIL_IF_HIDDEN);
diff --git a/pw_boot_armv7m/public/pw_boot_armv7m/boot.h b/pw_boot_armv7m/public/pw_boot_armv7m/boot.h
index 88e11dc..a7abd47 100644
--- a/pw_boot_armv7m/public/pw_boot_armv7m/boot.h
+++ b/pw_boot_armv7m/public/pw_boot_armv7m/boot.h
@@ -77,7 +77,7 @@
 
 // Forward declaration of main. Pigweed applications are expected to implement
 // this function. An implementation of main() is NOT provided by this module.
-int main();
+int main(void);
 
 // Reset handler or boot entry point.
 //
@@ -85,7 +85,7 @@
 // (which usually points to Reset_Handler) must be set to point to this
 // function. This function is implemented by pw_boot_armv7m, and does early
 // memory initialization.
-PW_NO_RETURN void pw_boot_Entry();
+PW_NO_RETURN void pw_boot_Entry(void);
 
 // pw_boot hook: Before static memory is initialized (user supplied)
 //
@@ -97,7 +97,7 @@
 // violates the C spec in several ways as .bss has not yet been zero-initialized
 // and static values have not yet been loaded into memory. This function is NOT
 // implemented by pw_boot_armv7m.
-void pw_boot_PreStaticMemoryInit();
+void pw_boot_PreStaticMemoryInit(void);
 
 // pw_boot hook: Before C++ static constructors are invoked (user supplied).
 //
@@ -107,7 +107,7 @@
 // function is called just before C++ static constructors are invoked. It is
 // safe to run C code, but NOT safe to call out to any C++ code. This function
 // is NOT implemented by pw_boot_armv7m.
-void pw_boot_PreStaticConstructorInit();
+void pw_boot_PreStaticConstructorInit(void);
 
 // pw_boot hook: Before main is invoked (user supplied).
 //
@@ -116,13 +116,13 @@
 // targets to have pre-main initialization of the device and seamlessly swap out
 // the main() implementation. This function is NOT implemented by
 // pw_boot_armv7m.
-void pw_boot_PreMainInit();
+void pw_boot_PreMainInit(void);
 
 // pw_boot hook: After main returned (user supplied).
 //
 // This is a hook function that users of pw_boot must supply. It is called by
 // pw_boot_Entry() after main() has returned. This function must not return!
 // This function is NOT implemented by pw_boot_armv7m.
-PW_NO_RETURN void pw_boot_PostMain();
+PW_NO_RETURN void pw_boot_PostMain(void);
 
 PW_EXTERN_C_END
diff --git a/pw_chrono/public/pw_chrono/system_clock.h b/pw_chrono/public/pw_chrono/system_clock.h
index 39093e2..6c42396 100644
--- a/pw_chrono/public/pw_chrono/system_clock.h
+++ b/pw_chrono/public/pw_chrono/system_clock.h
@@ -189,7 +189,7 @@
 typedef int64_t pw_chrono_SystemClock_Nanoseconds;
 
 // Returns the current time, see SystemClock::now() for more detail.
-pw_chrono_SystemClock_TimePoint pw_chrono_SystemClock_Now();
+pw_chrono_SystemClock_TimePoint pw_chrono_SystemClock_Now(void);
 
 // Returns the change in time between the current_time - last_time.
 pw_chrono_SystemClock_Duration pw_chrono_SystemClock_TimeElapsed(
diff --git a/pw_chrono/system_clock_facade_test_c.c b/pw_chrono/system_clock_facade_test_c.c
index 117d6d7..d8b21b6 100644
--- a/pw_chrono/system_clock_facade_test_c.c
+++ b/pw_chrono/system_clock_facade_test_c.c
@@ -17,7 +17,7 @@
 
 #include "pw_chrono/system_clock.h"
 
-pw_chrono_SystemClock_TimePoint pw_chrono_SystemClock_CallNow() {
+pw_chrono_SystemClock_TimePoint pw_chrono_SystemClock_CallNow(void) {
   return pw_chrono_SystemClock_Now();
 }
 
diff --git a/pw_log/basic_log_test_plain_c.c b/pw_log/basic_log_test_plain_c.c
index ead81f3..ee82374 100644
--- a/pw_log/basic_log_test_plain_c.c
+++ b/pw_log/basic_log_test_plain_c.c
@@ -28,11 +28,11 @@
 #error "This file must be compiled as plain C to verify C compilation works."
 #endif  // __cplusplus
 
-static void LoggingFromFunctionPlainC() { PW_LOG_INFO("From a function!"); }
+static void LoggingFromFunctionPlainC(void) { PW_LOG_INFO("From a function!"); }
 
 static void CustomFormatStringTest(void);
 
-void BasicLogTestPlainC() {
+void BasicLogTestPlainC(void) {
   int n = 3;
 
   // Debug level
diff --git a/pw_log_null/test_c.c b/pw_log_null/test_c.c
index 4143f63..6d568d7 100644
--- a/pw_log_null/test_c.c
+++ b/pw_log_null/test_c.c
@@ -23,7 +23,7 @@
 
 static int IncrementGlobal(void) { return ++global; }
 
-bool CTest() {
+bool CTest(void) {
   PW_LOG(1, 2, "3");
   PW_LOG(1, 2, "whoa");
   PW_LOG(1, 2, "%s", "hello");
diff --git a/pw_status/status_test_c.c b/pw_status/status_test_c.c
index d4f551d..6a31cae 100644
--- a/pw_status/status_test_c.c
+++ b/pw_status/status_test_c.c
@@ -23,7 +23,7 @@
 #define CHECK_STATUS_FROM_CPP(status) \
   (PW_STATUS_##status != PassStatusFromCpp(PW_STATUS_##status))
 
-int TestStatusFromC() {
+int TestStatusFromC(void) {
   int errors = 0;
 
   errors += CHECK_STATUS_FROM_CPP(OK);
@@ -52,7 +52,7 @@
 #define CHECK_STATUS_STRING(status) \
   (strcmp(#status, pw_StatusString(PW_STATUS_##status)) != 0)
 
-int TestStatusStringsFromC() {
+int TestStatusStringsFromC(void) {
   int errors = 0;
 
   errors += CHECK_STATUS_STRING(OK);
diff --git a/pw_trace/trace_backend_compile_test_c.c b/pw_trace/trace_backend_compile_test_c.c
index 0001775..4d99c07 100644
--- a/pw_trace/trace_backend_compile_test_c.c
+++ b/pw_trace/trace_backend_compile_test_c.c
@@ -22,7 +22,7 @@
 #error "This file must be compiled as plain C to verify C compilation works."
 #endif  // __cplusplus
 
-void BasicTraceTestPlainC() {
+void BasicTraceTestPlainC(void) {
   PW_TRACE_INSTANT("Test");
 
   PW_TRACE_START("Test");
diff --git a/pw_trace_tokenized/public/pw_trace_tokenized/config.h b/pw_trace_tokenized/public/pw_trace_tokenized/config.h
index db77230..b957610 100644
--- a/pw_trace_tokenized/public/pw_trace_tokenized/config.h
+++ b/pw_trace_tokenized/public/pw_trace_tokenized/config.h
@@ -40,7 +40,7 @@
 // provided by the platform.
 #ifndef PW_TRACE_GET_TIME
 #define PW_TRACE_GET_TIME() pw_trace_GetTraceTime()
-extern PW_TRACE_TIME_TYPE pw_trace_GetTraceTime();
+extern PW_TRACE_TIME_TYPE pw_trace_GetTraceTime(void);
 #endif  // PW_TRACE_GET_TIME
 
 // PW_TRACE_GET_TIME_TICKS_PER_SECOND is the macro which is called to determine
@@ -50,7 +50,7 @@
 #ifndef PW_TRACE_GET_TIME_TICKS_PER_SECOND
 #define PW_TRACE_GET_TIME_TICKS_PER_SECOND() \
   pw_trace_GetTraceTimeTicksPerSecond()
-extern size_t pw_trace_GetTraceTimeTicksPerSecond();
+extern size_t pw_trace_GetTraceTimeTicksPerSecond(void);
 #endif  // PW_TRACE_GET_TIME_TICKS_PER_SECOND
 
 // PW_TRACE_GET_TIME_DELTA is te macro which is called to determine
diff --git a/pw_trace_tokenized/public/pw_trace_tokenized/internal/trace_tokenized_internal.h b/pw_trace_tokenized/public/pw_trace_tokenized/internal/trace_tokenized_internal.h
index 5038887..8427dc6 100644
--- a/pw_trace_tokenized/public/pw_trace_tokenized/internal/trace_tokenized_internal.h
+++ b/pw_trace_tokenized/public/pw_trace_tokenized/internal/trace_tokenized_internal.h
@@ -73,7 +73,7 @@
 void pw_trace_Enable(bool enabled);
 
 // Returns true if tracing is currently enabled.
-bool pw_trace_IsEnabled();
+bool pw_trace_IsEnabled(void);
 
 PW_EXTERN_C_END
 
diff --git a/targets/lm3s6965evb-qemu/vector_table.c b/targets/lm3s6965evb-qemu/vector_table.c
index cbb5898..a9228c5 100644
--- a/targets/lm3s6965evb-qemu/vector_table.c
+++ b/targets/lm3s6965evb-qemu/vector_table.c
@@ -36,7 +36,7 @@
 // This typedef is for convenience when building the vector table. With the
 // exception of SP_main (0th entry in the vector table), all the entries of the
 // vector table are function pointers.
-typedef void (*InterruptHandler)();
+typedef void (*InterruptHandler)(void);
 
 PW_KEEP_IN_SECTION(".vector_table")
 const InterruptHandler vector_table[] = {
diff --git a/targets/stm32f429i-disc1/vector_table.c b/targets/stm32f429i-disc1/vector_table.c
index cbb5898..a9228c5 100644
--- a/targets/stm32f429i-disc1/vector_table.c
+++ b/targets/stm32f429i-disc1/vector_table.c
@@ -36,7 +36,7 @@
 // This typedef is for convenience when building the vector table. With the
 // exception of SP_main (0th entry in the vector table), all the entries of the
 // vector table are function pointers.
-typedef void (*InterruptHandler)();
+typedef void (*InterruptHandler)(void);
 
 PW_KEEP_IN_SECTION(".vector_table")
 const InterruptHandler vector_table[] = {