From 6c3466435b03fb84647f5ad413f98f2ccb12b5c2 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Fri, 16 Jun 2017 11:39:15 -0300 Subject: tools: Adopt __noreturn from kernel sources To have a more compact way to specify that a function doesn't return, instead of the open coded: __attribute__((noreturn)) And use it instead of the tools/perf/ specific variation, NORETURN. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-l0y144qzixcy5t4c6i7pdiqj@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/util.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'tools/perf/util/util.h') diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 5dfb9bb6482d..024b108dbbf6 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h @@ -11,20 +11,18 @@ #include #include #include +#include #include -#ifdef __GNUC__ -#define NORETURN __attribute__((__noreturn__)) -#else -#define NORETURN +#ifndef __GNUC__ #ifndef __attribute__ #define __attribute__(x) #endif #endif /* General helper functions */ -void usage(const char *err) NORETURN; -void die(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2))); +void usage(const char *err) __noreturn; +void die(const char *err, ...) __noreturn __attribute__((format (printf, 1, 2))); int error(const char *err, ...) __attribute__((format (printf, 1, 2))); void warning(const char *err, ...) __attribute__((format (printf, 1, 2))); -- cgit