libpfm4: fix compile error
PATCH 1/1 libpfm4: fix compile error
From: Kai Kang <[email protected]>
It fails to compile libpfm4 with misleading-indentation error:
| syst_count.c:346:3: error: this 'for' clause does not guard... [-Werror=misleading-indentation] | for(c=cmin ; c < cmax; c++) | ^~~
Add clauses to fix it.
Signed-off-by Kai Kang <[email protected]>
--- .../files/fix-misleading-indentation-error.patch | 38 ++++++++++++++++++++++ meta/recipes-kernel/libpfm/libpfm4_4.6.0.bb | 1 + 2 files changed, 39 insertions(+) create mode 100644 meta/recipes-kernel/libpfm/files/fix-misleading-indentation-error.patch
meta/recipes-kernel/libpfm/files/fix-misleading-indentation-error.patch new file +38 -0
@@ -0,0 +1,38 @@ +Upstream-Status: Pending + +Fix compile error: + +| syst_count.c:346:3: error: this 'for' clause does not guard... [-Werror=misleading-indentation] +| for(c=cmin ; c < cmax; c++) +| ^~~ + +Signed-off-by: Kai Kang <[email protected]> +--- +diff --git a/perf_examples/syst_count.c b/perf_examples/syst_count.c +index 0d53078..2dfb9b9 100644 +--- a/perf_examples/syst_count.c ++++ b/perf_examples/syst_count.c +@@ -343,8 +343,9 @@ measure(void) + + for (delay = 1 ; delay <= options.delay; delay++) { + +- for(c=cmin ; c < cmax; c++) +- start_cpu(c); ++ for(c=cmin ; c < cmax; c++) { ++ start_cpu(c); ++ } + + if (0) { + tv.tv_sec = 0; +@@ -353,8 +354,9 @@ measure(void) + } else + sleep(1); + +- for(c=cmin ; c < cmax; c++) +- stop_cpu(c); ++ for(c=cmin ; c < cmax; c++) { ++ stop_cpu(c); ++ } + + for(c = cmin; c < cmax; c++) { + printf("# %'ds -----\n", delay);
meta/recipes-kernel/libpfm/libpfm4_4.6.0.bb +1 -0
@@ -14,6 +14,7 @@ COMPATIBLE_HOST = "powerpc64" SRC_URI = "http://downloads.sourceforge.net/project/perfmon2/${BPN}/libpfm-${PV}.tar.gz \ file://0001-Makefile-Add-LDFLAGS-variable-to-SLDFLAGS.patch \ + file://fix-misleading-indentation-error.patch \ " SRC_URI[md5sum] = "5077b9022440e4951d96f2d0e73bd487"
Signature · 1 line
2.6.1
Quoted 9 lines · On 2016年06月29日 16:08, [email protected] wrote:
From: Kai Kang <[email protected]>
It fails to compile libpfm4 with misleading-indentation error:
| syst_count.c:346:3: error: this 'for' clause does not guard... [-Werror=misleading-indentation] | for(c=cmin ; c < cmax; c++) | ^~~Add clauses to fix it.
Oops...
s/clauses/braces/
--Kai
Quoted 64 lines
Signed-off-by Kai Kang <[email protected]>--- .../files/fix-misleading-indentation-error.patch | 38 ++++++++++++++++++++++ meta/recipes-kernel/libpfm/libpfm4_4.6.0.bb | 1 + 2 files changed, 39 insertions(+)create mode 100644
meta/recipes-kernel/libpfm/files/fix-misleading-indentation-error.patchmeta/recipes-kernel/libpfm/files/fix-misleading-indentation-error.patch new file +38
-0@@ -0,0 +1,38 @@ +Upstream-Status: Pending + +Fix compile error: + +| syst_count.c:346:3: error: this 'for' clause does not guard... [-Werror=misleading-indentation] +| for(c=cmin ; c < cmax; c++) +| ^~~ + +Signed-off-by: Kai Kang <[email protected]> +--- +diff --git a/perf_examples/syst_count.c b/perf_examples/syst_count.c +index 0d53078..2dfb9b9 100644 +--- a/perf_examples/syst_count.c ++++ b/perf_examples/syst_count.c +@@ -343,8 +343,9 @@ measure(void) + + for (delay = 1 ; delay <= options.delay; delay++) { + +- for(c=cmin ; c < cmax; c++) +- start_cpu(c); ++ for(c=cmin ; c < cmax; c++) { ++ start_cpu(c); ++ } + + if (0) { + tv.tv_sec = 0; +@@ -353,8 +354,9 @@ measure(void) + } else + sleep(1); + +- for(c=cmin ; c < cmax; c++) +- stop_cpu(c); ++ for(c=cmin ; c < cmax; c++) { ++ stop_cpu(c); ++ } + + for(c = cmin; c < cmax; c++) { + printf("# %'ds -----\n", delay);meta/recipes-kernel/libpfm/libpfm4_4.6.0.bb +1
-0@@ -14,6 +14,7 @@ COMPATIBLE_HOST = "powerpc64" SRC_URI = "http://downloads.sourceforge.net/project/perfmon2/${BPN}/libpfm-${PV}.tar.gz \ file://0001-Makefile-Add-LDFLAGS-variable-to-SLDFLAGS.patch \ + file://fix-misleading-indentation-error.patch \ " SRC_URI[md5sum] = "5077b9022440e4951d96f2d0e73bd487"
Signature · 2 lines
Regards, Neil | Kai Kang