Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1668040
| From | Kim Phillips <kim.phillips@arm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] [perf/core branch] perf coresight: Fix ARM builds caused by misplaced __printf |
| Date | 2017-06-16 22:00 +0200 |
| Message-ID | <tT5zr-4Er-5@gated-at.bofh.it> (permalink) |
| Organization | ARM |
Trailing __printf attributes work for function declarations, but not
definitions. This patch fixes arm32/64 builds by placing __printf
before the declarator. Otherwise this happens:
arch/arm64/util/../../arm/util/cs-etm.c:586:1: error: attributes should be specified before the declarator in a function definition
static int cs_device__print_file(const char *name, const char *fmt, ...) __printf(2, 3)
^~~~~~
arch/arm64/util/../../arm/util/cs-etm.c: In function ‘cs_etm_set_drv_config’:
arch/arm64/util/../../arm/util/cs-etm.c:610:8: error: implicit declaration of function ‘cs_device__print_file’ [-Werror=implicit-function-declaration]
ret = cs_device__print_file(enable_sink, "%d", 1);
^~~~~~~~~~~~~~~~~~~~~
arch/arm64/util/../../arm/util/cs-etm.c:610:2: error: nested extern declaration of ‘cs_device__print_file’ [-Werror=nested-externs]
ret = cs_device__print_file(enable_sink, "%d", 1);
^~~
At top level:
arch/arm64/util/../../arm/util/cs-etm.c:566:14: error: ‘cs_device__open_file’ defined but not used [-Werror=unused-function]
static FILE *cs_device__open_file(const char *name)
^~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Fixes: 2ee261d962ac "tools: Adopt __printf from kernel sources"
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Kim Phillips <kim.phillips@arm.com>
---
Applies to acme's perf/core branch
tools/perf/arch/arm/util/cs-etm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
index 90a6f42ba904..7ce3d1a25133 100644
--- a/tools/perf/arch/arm/util/cs-etm.c
+++ b/tools/perf/arch/arm/util/cs-etm.c
@@ -583,7 +583,7 @@ static FILE *cs_device__open_file(const char *name)
}
-static int cs_device__print_file(const char *name, const char *fmt, ...) __printf(2, 3)
+static int __printf(2, 3) cs_device__print_file(const char *name, const char *fmt, ...)
{
va_list args;
FILE *file;
--
2.11.0
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] [perf/core branch] perf coresight: Fix ARM builds caused by misplaced __printf Kim Phillips <kim.phillips@arm.com> - 2017-06-16 22:00 +0200
Re: [PATCH] [perf/core branch] perf coresight: Fix ARM builds caused by misplaced __printf Mathieu Poirier <mathieu.poirier@linaro.org> - 2017-06-19 20:00 +0200
Re: [PATCH] [perf/core branch] perf coresight: Fix ARM builds caused by misplaced __printf Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-06-19 20:50 +0200
Re: [PATCH] [perf/core branch] perf coresight: Fix ARM builds caused by misplaced __printf Kim Phillips <kim.phillips@arm.com> - 2017-06-19 21:30 +0200
Re: [PATCH] [perf/core branch] perf coresight: Fix ARM builds caused by misplaced __printf Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-06-19 22:00 +0200
Re: [PATCH] [perf/core branch] perf coresight: Fix ARM builds caused by misplaced __printf Kim Phillips <kim.phillips@arm.com> - 2017-06-19 22:30 +0200
csiph-web