diff mbox series

[v1,3/6] perf build: Add Wextra for C++ compilation

Message ID 20230728064917.767761-4-irogers@google.com (mailing list archive)
State Not Applicable
Headers show
Series Simplify C/C++ compiler flags | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Ian Rogers July 28, 2023, 6:49 a.m. UTC
Commit d58ac0bf8d1e ("perf build: Add clang and llvm compile and
linking support") added -Wall and -Wno-strict-aliasing for CXXFLAGS,
but not -Wextra. -Wno-strict-aliasing is no longer necessary, adding
-Wextra for CXXFLAGS requires adding -Wno-unused-parameter clang.cpp
and clang-test.cpp for LIBCLANGLLVM=1 to build.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/Makefile.config | 2 +-
 tools/perf/util/c++/Build  | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

Comments

James Clark July 28, 2023, 8:57 a.m. UTC | #1
On 28/07/2023 07:49, Ian Rogers wrote:
> Commit d58ac0bf8d1e ("perf build: Add clang and llvm compile and
> linking support") added -Wall and -Wno-strict-aliasing for CXXFLAGS,
> but not -Wextra. -Wno-strict-aliasing is no longer necessary, adding
> -Wextra for CXXFLAGS requires adding -Wno-unused-parameter clang.cpp
> and clang-test.cpp for LIBCLANGLLVM=1 to build.
> 
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
>  tools/perf/Makefile.config | 2 +-
>  tools/perf/util/c++/Build  | 3 +++
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> index 14709a6bd622..fe7afe6d8529 100644
> --- a/tools/perf/Makefile.config
> +++ b/tools/perf/Makefile.config
> @@ -333,8 +333,8 @@ CORE_CFLAGS += -std=gnu11
>  
>  CXXFLAGS += -std=gnu++14 -fno-exceptions -fno-rtti
>  CXXFLAGS += -Wall
> +CXXFLAGS += -Wextra
>  CXXFLAGS += -fno-omit-frame-pointer
> -CXXFLAGS += -Wno-strict-aliasing
>  
>  HOSTCFLAGS += -Wall
>  HOSTCFLAGS += -Wextra
> diff --git a/tools/perf/util/c++/Build b/tools/perf/util/c++/Build
> index 613ecfd76527..8610d032ac19 100644
> --- a/tools/perf/util/c++/Build
> +++ b/tools/perf/util/c++/Build
> @@ -1,2 +1,5 @@
>  perf-$(CONFIG_CLANGLLVM) += clang.o
>  perf-$(CONFIG_CLANGLLVM) += clang-test.o
> +
> +CXXFLAGS_clang.o += -Wno-unused-parameter
> +CXXFLAGS_clang-test.o += -Wno-unused-parameter

Acked-by: James Clark <james.clark@arm.com>
diff mbox series

Patch

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 14709a6bd622..fe7afe6d8529 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -333,8 +333,8 @@  CORE_CFLAGS += -std=gnu11
 
 CXXFLAGS += -std=gnu++14 -fno-exceptions -fno-rtti
 CXXFLAGS += -Wall
+CXXFLAGS += -Wextra
 CXXFLAGS += -fno-omit-frame-pointer
-CXXFLAGS += -Wno-strict-aliasing
 
 HOSTCFLAGS += -Wall
 HOSTCFLAGS += -Wextra
diff --git a/tools/perf/util/c++/Build b/tools/perf/util/c++/Build
index 613ecfd76527..8610d032ac19 100644
--- a/tools/perf/util/c++/Build
+++ b/tools/perf/util/c++/Build
@@ -1,2 +1,5 @@ 
 perf-$(CONFIG_CLANGLLVM) += clang.o
 perf-$(CONFIG_CLANGLLVM) += clang-test.o
+
+CXXFLAGS_clang.o += -Wno-unused-parameter
+CXXFLAGS_clang-test.o += -Wno-unused-parameter