From f5c2d780a61de1f94ccfdbd0608c6bd0e502f7be Mon Sep 17 00:00:00 2001 From: Klaas Speller Date: Tue, 5 Sep 2023 11:53:51 +0200 Subject: [PATCH 1/2] Make void argument explicit in function typedefs CMake build could fail when building with -Werror and -Wstrict-prototypes due to implicit void argument in function typedefs. This commit adds explicit void argument the following: * typedef void (*lockPreemptionType) (void); * typedef void (*unlockPreemptionType) (void); * const char* fmi2GetVersion(void) * const char* fmi2GetTypesPlatform(void) --- include/model.h | 5 +++-- src/fmi2Functions.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/model.h b/include/model.h index 8a6bf2ca..11b4be65 100644 --- a/include/model.h +++ b/include/model.h @@ -87,8 +87,9 @@ typedef void (*loggerType) (void *componentEnvironment, const char *instanceName typedef void (*loggerType) (void *componentEnvironment, int status, const char *category, const char *message); #endif -typedef void (*lockPreemptionType) (); -typedef void (*unlockPreemptionType) (); +typedef void (*lockPreemptionType) (void); +typedef void (*unlockPreemptionType) (void); + typedef void (*intermediateUpdateType) (void *instanceEnvironment, double intermediateUpdateTime, diff --git a/src/fmi2Functions.c b/src/fmi2Functions.c index 36783e0a..92cddc66 100644 --- a/src/fmi2Functions.c +++ b/src/fmi2Functions.c @@ -309,11 +309,11 @@ void fmi2FreeInstance(fmi2Component c) { // FMI functions: class methods not depending of a specific model instance // --------------------------------------------------------------------------- -const char* fmi2GetVersion() { +const char* fmi2GetVersion(void) { return fmi2Version; } -const char* fmi2GetTypesPlatform() { +const char* fmi2GetTypesPlatform(void) { return fmi2TypesPlatform; } From 411f9e0044e0fea1267b1d1dbe64c52fe8fa18af Mon Sep 17 00:00:00 2001 From: Torsten Sommer Date: Wed, 6 Sep 2023 10:32:41 +0200 Subject: [PATCH 2/2] Add explicit void argument to preemption callbacks --- include/fmi3FunctionTypes.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/fmi3FunctionTypes.h b/include/fmi3FunctionTypes.h index ca97b70f..1e20ebbb 100644 --- a/include/fmi3FunctionTypes.h +++ b/include/fmi3FunctionTypes.h @@ -103,8 +103,8 @@ typedef void (*fmi3IntermediateUpdateCallback) ( /* end::CallbackIntermediateUpdate[] */ /* tag::CallbackPreemptionLock[] */ -typedef void (*fmi3LockPreemptionCallback) (); -typedef void (*fmi3UnlockPreemptionCallback) (); +typedef void (*fmi3LockPreemptionCallback) (void); +typedef void (*fmi3UnlockPreemptionCallback) (void); /* end::CallbackPreemptionLock[] */ /* Define fmi3 function pointer types to simplify dynamic loading */