From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2EAAAA034D; Fri, 21 Jan 2022 16:54:02 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A08804276D; Fri, 21 Jan 2022 16:54:01 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id A740C40040 for ; Fri, 21 Jan 2022 16:53:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642780439; x=1674316439; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=1m2HNVPA9ZQvpoW1bsNC4gHDtDVfFNu+OuSkAWaZbjo=; b=OVNuM+mxVZiHDlhj6j1hELZGtgJzEjCkwt3zFqoKTFOgxxV7fDEEIxbZ yd1ardLwVMiZC3h9y1WzFL7MeSk27989nhMRO4Ls9lMNPQITZKc2z1A5b D7ElzlP3MY/pcxwRkawvle/afJIjoR1Z5A2R4jyLe5v3RbUpkQmqPO2Kd PN0Z/RbefaP5RzEegkzG0VzYGvGDMAFx5o80GtemBme1L9ACS5RNr02Or H7eWhKekXj1IwDKKygZuItRHoTHX18x927VfX9uC9Y0chnv+8PqU/GzwD fOKHMiVVuGDS0QONpUJ1ID+Ozch+X7v3wIA6FGr8POUlI1OIqY7llXFEZ A==; X-IronPort-AV: E=McAfee;i="6200,9189,10233"; a="225664586" X-IronPort-AV: E=Sophos;i="5.88,304,1635231600"; d="scan'208";a="225664586" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2022 07:53:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,304,1635231600"; d="scan'208";a="478283970" Received: from silpixa00399126.ir.intel.com ([10.237.223.86]) by orsmga006.jf.intel.com with ESMTP; 21 Jan 2022 07:53:57 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: bluca@debian.org, Bruce Richardson Subject: [PATCH] build: fix meson warning about using compiler warning flags Date: Fri, 21 Jan 2022 15:53:46 +0000 Message-Id: <20220121155346.1994682-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- NOTE1: Not putting CC stable for this patch, I don't believe it's worth the risk of backporting. NOTE2: For reference, when building a test "hello world" project with different warning levels, the following flags are used by meson: warning_level=0: warning_level=1: -Wall -Winvalid-pch warning_level=2: -Wall -Winvalid-pch -Wextra warning_level=3: -Wall -Winvalid-pch -Wextra -Wpedantic --- config/meson.build | 5 ++--- meson.build | 2 +- 2 files changed, 3 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..070243a33d 100644 --- a/meson.build +++ b/meson.build @@ -7,7 +7,7 @@ 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.32.0