Skip to content

Commit

Permalink
build: fix warning about using -Wextra flag
Browse files Browse the repository at this point in the history
[ upstream commit d832326 ]

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: 524a0d5 ("build: enable extra warnings with meson")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
  • Loading branch information
bruce-richardson authored and bluca committed Feb 17, 2022
1 parent 1442174 commit 3215df7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 2 additions & 3 deletions config/meson.build
Expand Up @@ -194,10 +194,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',
Expand Down
6 changes: 5 additions & 1 deletion meson.build
Expand Up @@ -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.47.1'
)

Expand Down

0 comments on commit 3215df7

Please sign in to comment.