loader: Add void to function arguments
authorJohn Bauman <jbauman@google.com>
Fri, 2 Jun 2023 16:31:05 +0000 (16:31 +0000)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Fri, 2 Jun 2023 19:20:33 +0000 (13:20 -0600)
UBSan was detecting a function type mismatch for these module
ctor/dtors since libc expects the function type to be void (*)(void)
rather than just void (*)().

loader/loader.c

index 1eb84ec4ee7c7b4581b43c7336ad6106e1a040a5..a2d058c841bf254f1d580e9a916265bedb453d86 100644 (file)
@@ -1940,9 +1940,9 @@ void loader_unload_preloaded_icds(void) {
 }
 
 #if !defined(_WIN32)
-__attribute__((constructor)) void loader_init_library() { loader_initialize(); }
+__attribute__((constructor)) void loader_init_library(void) { loader_initialize(); }
 
-__attribute__((destructor)) void loader_free_library() { loader_release(); }
+__attribute__((destructor)) void loader_free_library(void) { loader_release(); }
 #endif
 
 // Get next file or dirname given a string list or registry key path