]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
testsuite: Fix build with gcc < 15 master
authorLucas De Marchi <lucas.de.marchi@gmail.com>
Fri, 11 Jul 2025 15:53:53 +0000 (10:53 -0500)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Mon, 14 Jul 2025 03:18:34 +0000 (22:18 -0500)
Variable declaration inside a switch case works with gcc 15, but fails
pretty much everywhere else with a message like below:

../testsuite/init_module.c: In function â€˜syscall’:
../testsuite/init_module.c:343:3: error: a label can only be part of a statement and a declaration is not a statement
  343 |   const char *args;
      |   ^~~~~

Add an empty statement to fix it.

Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/390
testsuite/init_module.c

index 6ad95d7faa46da54ffe16751ac910ae608b1da33..4cdc0824002d1006c5c8024f897e1264e48f26da 100644 (file)
@@ -339,7 +339,7 @@ TS_EXPORT long int syscall(long int __sysno, ...)
 #endif
                errno = ENOSYS;
                return -1;
-       case __NR_finit_module:
+       case __NR_finit_module:;
                const char *args;
                int flags;
                int fd;
@@ -354,7 +354,7 @@ TS_EXPORT long int syscall(long int __sysno, ...)
 
                va_end(ap);
                return ret;
-       case __NR_gettid:
+       case __NR_gettid:;
                static long (*nextlib_syscall)(long number, ...);
 
                if (nextlib_syscall == NULL) {