From d832326ae9b1b67c2976da293a459b51297fcfa0 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Fri, 21 Jan 2022 16:12:30 +0000 Subject: [PATCH] build: fix warning about using -Wextra flag Each build, meson would issue a warning reporting that the "warning_level" setting should be used in place of adding -Wextra directly to our build commands. Testing with meson 0.61 shows that the only difference for gcc and clang builds between warning levels 1 and 2 is the addition of -Wextra, so we can remove the warning by deleting our explicit set of Wextra and changing the build defaults to warning_level 2. Fixes: 524a0d5d66b9 ("build: enable extra warnings with meson") Signed-off-by: Bruce Richardson Acked-by: Luca Boccassi --- config/meson.build | 5 ++--- meson.build | 6 +++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/config/meson.build b/config/meson.build index ee12318d4f..7134e80e8d 100644 --- a/config/meson.build +++ b/config/meson.build @@ -247,10 +247,9 @@ endif add_project_arguments('-include', 'rte_config.h', language: 'c') # enable extra warnings and disable any unwanted warnings +# -Wall is added by default at warning level 1, and -Wextra +# at warning level 2 (DPDK default) warning_flags = [ - # -Wall is added by meson by default, so add -Wextra only - '-Wextra', - # additional warnings in alphabetical order '-Wcast-qual', '-Wdeprecated', diff --git a/meson.build b/meson.build index 1223b79d74..3d97e96f38 100644 --- a/meson.build +++ b/meson.build @@ -7,7 +7,11 @@ project('DPDK', 'C', version: run_command(find_program('cat', 'more'), files('VERSION'), check: true).stdout().strip(), license: 'BSD', - default_options: ['buildtype=release', 'default_library=static'], + default_options: [ + 'buildtype=release', + 'default_library=static', + 'warning_level=2', + ], meson_version: '>= 0.49.2' ) -- 2.39.5