]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
Mark functions with attribute noreturn
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Wed, 8 Feb 2012 22:32:31 +0000 (20:32 -0200)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Wed, 8 Feb 2012 22:32:31 +0000 (20:32 -0200)
Functions that always call exit() should be marked with attribute
noreturn. With glibc this is not necessary, but it fails to compile with
uClibc otherwise.

testsuite/test-init.c
testsuite/test-modinfo.c
testsuite/test-modprobe.c
testsuite/test-testsuite.c
testsuite/testsuite.h

index c807a16b73ae685b2fc05ef9cdfb957284b35eef..f09c4d21377ca12d2c3a9d233e65d3af47113708 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "testsuite.h"
 
-static int test_initlib(const struct test *t)
+static __noreturn int test_initlib(const struct test *t)
 {
        struct kmod_ctx *ctx;
        const char *null_config = NULL;
@@ -41,7 +41,7 @@ static int test_initlib(const struct test *t)
 static DEFINE_TEST(test_initlib,
                .description = "test if libkmod's init function work");
 
-static int test_insert(const struct test *t)
+static __noreturn int test_insert(const struct test *t)
 {
        struct kmod_ctx *ctx;
        struct kmod_module *mod;
@@ -75,7 +75,7 @@ static DEFINE_TEST(test_insert,
        },
        .need_spawn = true);
 
-static int test_remove(const struct test *t)
+static __noreturn int test_remove(const struct test *t)
 {
        struct kmod_ctx *ctx;
        struct kmod_module *mod;
index 007cc0a3737b7f860a8f0b8b7d9c72152d45a0e1..0ff699894693ae4b5a5ee38c7fe95253fd70eb3a 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "testsuite.h"
 
-static int modinfo_jonsmodules(const struct test *t)
+static __noreturn int modinfo_jonsmodules(const struct test *t)
 {
        const char *progname = ABS_TOP_BUILDDIR "/tools/modinfo";
        const char *const args[] = {
index cbcd157b91b9d8b04e4df1f3d4551c0a3186df64..38d6c4c45d8963e4fae76f86cb55ffb000614fbd 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "testsuite.h"
 
-static int modprobe_show_depends(const struct test *t)
+static __noreturn int modprobe_show_depends(const struct test *t)
 {
        const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
        const char *const args[] = {
@@ -47,7 +47,7 @@ static DEFINE_TEST(modprobe_show_depends,
                .stdout = TESTSUITE_ROOTFS "test-modprobe/show-depends/correct.txt",
        });
 
-static int modprobe_show_depends2(const struct test *t)
+static __noreturn int modprobe_show_depends2(const struct test *t)
 {
        const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
        const char *const args[] = {
index 1c12830572d46e97997650472a5a23dad4fa49c4..043e09d5c20d332701c466e0ef8d6946b19ede1c 100644 (file)
@@ -31,7 +31,7 @@
 
 
 #define TEST_UNAME "4.0.20-kmod"
-static int testsuite_uname(const struct test *t)
+static __noreturn int testsuite_uname(const struct test *t)
 {
        struct utsname u;
        int err = uname(&u);
index 015120645326408756048876873133dbf7d73ad9..609368364218ed532787d6923e8553065d37e169 100644 (file)
@@ -138,3 +138,5 @@ int test_run(const struct test *t);
        }                                                       \
 
 #endif
+
+#define __noreturn __attribute__((noreturn))