#define _unused_ __attribute__((unused))
#define _always_inline_ __inline__ __attribute__((always_inline))
#define _cleanup_(x) __attribute__((cleanup(x)))
+
+/* Define C11 noreturn without <stdnoreturn.h> and even on older gcc
+ * compiler versions */
+#ifndef noreturn
+#if __STDC_VERSION__ >= 201112L
+#define noreturn _Noreturn
+#else
+#define noreturn __attribute__((noreturn))
+#endif
+#endif
#define MODULES_ORDER_UNAME "3.5.4-1-ARCH"
#define MODULES_ORDER_ROOTFS TESTSUITE_ROOTFS "test-depmod/modules-order-compressed"
#define MODULES_ORDER_LIB_MODULES MODULES_ORDER_ROOTFS "/lib/modules/" MODULES_ORDER_UNAME
-static __noreturn int depmod_modules_order_for_compressed(const struct test *t)
+static noreturn int depmod_modules_order_for_compressed(const struct test *t)
{
const char *progname = ABS_TOP_BUILDDIR "/tools/depmod";
const char *const args[] = {
#include "testsuite.h"
-static __noreturn 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;
static DEFINE_TEST(test_initlib,
.description = "test if libkmod's init function work");
-static __noreturn int test_insert(const struct test *t)
+static noreturn int test_insert(const struct test *t)
{
struct kmod_ctx *ctx;
struct kmod_module *mod;
},
.need_spawn = true);
-static __noreturn int test_remove(const struct test *t)
+static noreturn int test_remove(const struct test *t)
{
struct kmod_ctx *ctx;
struct kmod_module *mod;
#include "testsuite.h"
-static __noreturn 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[] = {
#include "testsuite.h"
-static __noreturn 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[] = {
.out = TESTSUITE_ROOTFS "test-modprobe/show-depends/correct.txt",
});
-static __noreturn 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[] = {
});
-static __noreturn int modprobe_show_alias_to_none(const struct test *t)
+static noreturn int modprobe_show_alias_to_none(const struct test *t)
{
const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
const char *const args[] = {
});
-static __noreturn int modprobe_builtin(const struct test *t)
+static noreturn int modprobe_builtin(const struct test *t)
{
const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
const char *const args[] = {
[TC_ROOTFS] = TESTSUITE_ROOTFS "test-modprobe/builtin",
});
-static __noreturn int modprobe_softdep_loop(const struct test *t)
+static noreturn int modprobe_softdep_loop(const struct test *t)
{
const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
const char *const args[] = {
[TC_INIT_MODULE_RETCODES] = "",
});
-static __noreturn int modprobe_install_cmd_loop(const struct test *t)
+static noreturn int modprobe_install_cmd_loop(const struct test *t)
{
const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
const char *const args[] = {
},
);
-static __noreturn int modprobe_param_kcmdline(const struct test *t)
+static noreturn int modprobe_param_kcmdline(const struct test *t)
{
const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
const char *const args[] = {
#define TEST_UNAME "4.0.20-kmod"
-static __noreturn int testsuite_uname(const struct test *t)
+static noreturn int testsuite_uname(const struct test *t)
{
struct utsname u;
int err = uname(&u);
#include <stdbool.h>
#include <stdarg.h>
+#include "macro.h"
+
struct test;
typedef int (*testfunc)(const struct test *t);
exit(EXIT_SUCCESS); \
} \
-#define __noreturn __attribute__((noreturn))
+#ifdef noreturn
+# define __noreturn noreturn
+#elif __STDC_VERSION__ >= 201112L
+# define __noreturn _Noreturn
+#else
+# define __noreturn __attribute__((noreturn))
+#endif