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 45C5845B2C; Sun, 13 Oct 2024 23:16:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 10A82402D3; Sun, 13 Oct 2024 23:16:16 +0200 (CEST) Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) by mails.dpdk.org (Postfix) with ESMTP id CDFCC4027F for ; Sun, 13 Oct 2024 23:16:14 +0200 (CEST) Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-7d916b6a73aso2228927a12.1 for ; Sun, 13 Oct 2024 14:16:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728854174; x=1729458974; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=1Xcz9rZsrIxrrE3LIcyri6iPLL1ns/4NvMyJSG9xjgo=; b=oLzsrt9jqW0TDn5PB7iavemewgtY6lcz9cJHd/MxtujiGIZijwr07K7CW52LoXZGsl QJYlIxazDgMj24Hq0zBMt0bpf5gI/OEe5xrHvd49rRdfk8nuZGcpBlRUewNNfX5ux3Gx swqYtfrUbutIIUFJzfSnQlfMsAdvj6lMK+MVtZqqUteo1kVw2D/wylK1Kh6qOsaJvBnt R+TEwkR1vcADG2ImHtTywcraW7a7f1SJFovLdmHuLBf5kfumYJ+5lHTnKgbefNPi4YPK Cj86bV/kDiVieVWtjxzbXHI3MOvI8iJcD90s6M+Wi+GsOnq6gYS/Vpz0ur73K5JFSylb ASkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728854174; x=1729458974; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1Xcz9rZsrIxrrE3LIcyri6iPLL1ns/4NvMyJSG9xjgo=; b=iyXGhmYgaubh4AcCM4mQ+lJj08AKxV5R5DBw/TQdV50hawehB8wwYsOA9XlqGLqwpc fJoe50KfLSjQZqU1vmnk8BPIUuTsHiRdpH9owyj9ddK9CQvw1QbCWc/3SUfOFftwTRjp MC8KhrZq6oQmSbj3d6Ccc0ynU/yasg24MrMCJYUiLHhOdnn1IiBdBTSfo16fp/ZnLo+c BdeNAQw/kwb1iAfysm6JP82mjMtVqdfpWJ0Ziimav53vgSyOERcpihwKZ6w9+eUOIoeO R3OxozQVEbu+kMweGfonpxwOHVBj6QXrWrHH+ZRMzutPA5L0OHPjY0S5jj8N/b4LXgAV 34Jw== X-Gm-Message-State: AOJu0YwDJwtEbfpu7LC9oS3eXuSOujLc1kFqEUC0fcjQJ5EXvIRd5hfZ 2yy/x8vX3nGftEnX4iS1359BtVl4q6Ndt4zm31WVLw8tP8VnrSsO7sr4e1aIFRk= X-Google-Smtp-Source: AGHT+IGg2vQjQH6zBL6iXtxlRxGOqi/Jz4qo7vMwxGX/ZFmLSQIelyNn18tUUsj88j+WAn2GLp6Hdw== X-Received: by 2002:a05:6a21:178a:b0:1d8:a13d:723d with SMTP id adf61e73a8af0-1d8bcfb6077mr13732693637.31.1728854173775; Sun, 13 Oct 2024 14:16:13 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7ea4495a75asm5574589a12.65.2024.10.13.14.16.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Oct 2024 14:16:13 -0700 (PDT) Date: Sun, 13 Oct 2024 14:16:11 -0700 From: Stephen Hemminger To: Sebastian Brzezinka Cc: dev@dpdk.org, Alexey Marchuk Subject: Re: [PATCH 1/2] meson/mlx5: Suppress -Wunused-value diagnostic Message-ID: <20241013141611.0468b324@hermes.local> In-Reply-To: <20240412111317.3530529-1-sebastian.brzezinka@intel.com> References: <20240412111317.3530529-1-sebastian.brzezinka@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Fri, 12 Apr 2024 13:13:16 +0200 Sebastian Brzezinka wrote: > From: Alexey Marchuk > > mlx5 common library checks if several symbols/definitions > are presented in system header files. If some are not > presented, they will be enabled by mlx5_glue library. > The problem appears with clang and '-Werror' - code > generated by meson is not compiled due to unused variable: > > Code: > > #include > int main(void) { > /* If it's not defined as a macro, try to use as a symbol */ > #ifndef mlx5dv_create_flow_action_packet_reformat > mlx5dv_create_flow_action_packet_reformat; > #endif > return 0; > } > Compiler stdout: > > Compiler stderr: > /hpc/local/work/alexeymar/repo/spdk/dpdk/build-tmp/meson-private/tmp5obnak86/testfile.c:6:17: error: expression result unused [-Werror,-Wunused-value] > mlx5dv_create_flow_action_packet_reformat; > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > As result, almost all symbols are enabled in mlx5_glue while > they exist is system headers. As result, we get multiple > symbols redefenitions when we compile mlx5_common. > As a solution for this problem we can suppress > -Wunused-vaurable using pragma > > DPDK 23.11 note: > Starting with commit below, all cflags are passed to the has_header_symbol(). > (33d6694) build: use C11 standard > To make sure that the symbol is properly detected, the pedantic flags needs to > be removed. > > Signed-off-by: Alexey Marchuk > Signed-off-by: Sebastian Brzezinka > --- > drivers/common/mlx5/linux/meson.build | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/common/mlx5/linux/meson.build b/drivers/common/mlx5/linux/meson.build > index cdee40c553..f3b8e5741b 100644 > --- a/drivers/common/mlx5/linux/meson.build > +++ b/drivers/common/mlx5/linux/meson.build > @@ -209,7 +209,11 @@ if libmtcr_ul_found > endif > > foreach arg:has_sym_args > - mlx5_config.set(arg[0], cc.has_header_symbol(arg[1], arg[2], dependencies: libs, args: cflags)) > + file_prefix = '#pragma clang diagnostic ignored "-Wunused-value"' > + cflags += [ > + '-Wno-pedantic', > + ] > + mlx5_config.set(arg[0], cc.has_header_symbol(arg[1], arg[2], prefix : file_prefix, dependencies: libs, args: cflags)) > endforeach > foreach arg:has_member_args > file_prefix = '#include <' + arg[1] + '>' Sigh, never liked that mlx5 decided to use pedantic unlike other drivers. And the build process for this driver has become more baroque and unique compared to all the other drivers in DPDK. What value to the user is this complexity?