From 321b759af24d3630773c7a3725de3296d60f54f4 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sat, 30 Aug 2025 15:47:24 +0200 Subject: [PATCH] elfclassify: Use (void) for no-argument static functions, not () MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In -std=gnu11 mode gcc will error out on nor argument () static functions: src/elfclassify.c:757:1: error: function declaration isn’t a prototype [-Werror=strict-prototypes] 757 | check_checks () | ^~~~~~~~~~~~ src/elfclassify.c: In function ‘check_checks’: src/elfclassify.c:757:1: error: old-style function definition [-Werror=old-style-definition] This isn't an issue in -std=gnu23 mode (the default with GCC 15): A definition using () is not considered an old-style definition in C23 mode, because it is equivalent to (void) in that case, but is considered an old-style definition for older standards So just always use (void) instead of () for an empty argument list. * src/elfclassify.c (check_checks): Define as check_checks (void). (check_ar_members): Define as check_ar_members (void). Signed-off-by: Mark Wielaard --- src/elfclassify.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/elfclassify.c b/src/elfclassify.c index fd84f90d..307771b2 100644 --- a/src/elfclassify.c +++ b/src/elfclassify.c @@ -754,7 +754,7 @@ parse_opt (int key, char *arg __attribute__ ((unused)), } static bool -check_checks () +check_checks (void) { bool checks_passed = true; bool checks[] = @@ -824,7 +824,7 @@ check_checks () } static bool -check_ar_members () +check_ar_members (void) { char *ar_path = current_path; Elf *ar_elf = elf; -- 2.47.3