From 9d5b333fb6e548aa2a9cda9094ad7e96e3eb33f7 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Mon, 20 Nov 2023 17:21:48 +0100 Subject: src|tests: Address warning -Wstrict-prototypes Symptom with Clang 15: > In file included from userinfo.c:20: > ./userinfo.h:38:27: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] > void invalidate_user_cache(); /* safe to call from signal handler */ > ^ > void > [many more] --- src/userinfo.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/userinfo.c') diff --git a/src/userinfo.c b/src/userinfo.c index a3ac91c..68291c1 100644 --- a/src/userinfo.c +++ b/src/userinfo.c @@ -52,13 +52,13 @@ static struct memory_block cache_memory_block = MEMORY_BLOCK_INITIALIZER; static volatile int cache_rebuild_requested = 1; -static void rebuild_cache(); +static void rebuild_cache(void); static struct uid_cache_entry *uid_cache_lookup(uid_t key); static struct gid_cache_entry *gid_cache_lookup(gid_t key); -static int rebuild_uid_cache(); -static int rebuild_gid_cache(); -static void clear_uid_cache(); -static void clear_gid_cache(); +static int rebuild_uid_cache(void); +static int rebuild_gid_cache(void); +static void clear_uid_cache(void); +static void clear_gid_cache(void); static int uid_cache_name_sortcmp(const void *key, const void *entry); static int uid_cache_name_searchcmp(const void *key, const void *entry); static int uid_cache_uid_sortcmp(const void *key, const void *entry); @@ -66,7 +66,7 @@ static int uid_cache_uid_searchcmp(const void *key, const void *entry); static int gid_cache_gid_sortcmp(const void *key, const void *entry); static int gid_cache_gid_searchcmp(const void *key, const void *entry); -static void rebuild_cache() +static void rebuild_cache(void) { free_memory_block(&cache_memory_block); init_memory_block(&cache_memory_block, 1024); @@ -98,7 +98,7 @@ static struct gid_cache_entry *gid_cache_lookup(gid_t key) ); } -static int rebuild_uid_cache() +static int rebuild_uid_cache(void) { /* We're holding the lock, so we have mutual exclusion on getpwent and getgrent too. */ struct passwd *pw; @@ -144,7 +144,7 @@ error: return 0; } -static int rebuild_gid_cache() +static int rebuild_gid_cache(void) { /* We're holding the lock, so we have mutual exclusion on getpwent and getgrent too. */ struct group *gr; @@ -205,12 +205,12 @@ error: return 0; } -static void clear_uid_cache() +static void clear_uid_cache(void) { uid_cache_size = 0; } -static void clear_gid_cache() +static void clear_gid_cache(void) { gid_cache_size = 0; } @@ -361,7 +361,7 @@ done: return ret; } -void invalidate_user_cache() +void invalidate_user_cache(void) { cache_rebuild_requested = 1; } -- cgit v1.2.3