aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/util.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2017-06-16 11:57:54 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-06-19 15:25:26 -0300
commitafaed6d3e4aa56e939b496aafa5c97852e223122 (patch)
treeeed63017d5b665d988785fcbd67f8f75bfe553a3 /tools/perf/util/util.h
parenttools: Adopt __noreturn from kernel sources (diff)
downloadlinux-dev-afaed6d3e4aa56e939b496aafa5c97852e223122.tar.xz
linux-dev-afaed6d3e4aa56e939b496aafa5c97852e223122.zip
tools: Adopt __printf from kernel sources
To have a more compact way to ask the compiler to perform printf like vargargs validation. v2: Fixed up build on arm, squashing a patch by Kim Phillips, thanks! Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kim Phillips <kim.phillips@arm.com> Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-dopkqmmuqs04cxzql0024nnu@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/util.h')
-rw-r--r--tools/perf/util/util.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index 024b108dbbf6..21c6db173bcc 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -14,17 +14,11 @@
#include <linux/compiler.h>
#include <linux/types.h>
-#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)));
-int error(const char *err, ...) __attribute__((format (printf, 1, 2)));
-void warning(const char *err, ...) __attribute__((format (printf, 1, 2)));
+void die(const char *err, ...) __noreturn __printf(1, 2);
+int error(const char *err, ...) __printf(1, 2);
+void warning(const char *err, ...) __printf(1, 2);
void set_warning_routine(void (*routine)(const char *err, va_list params));