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 CD50342A5B; Thu, 4 May 2023 10:47:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6073341144; Thu, 4 May 2023 10:47:23 +0200 (CEST) Received: from mail-vk1-f178.google.com (mail-vk1-f178.google.com [209.85.221.178]) by mails.dpdk.org (Postfix) with ESMTP id A2752410DC; Thu, 4 May 2023 10:47:21 +0200 (CEST) Received: by mail-vk1-f178.google.com with SMTP id 71dfb90a1353d-446ed123287so75111e0c.1; Thu, 04 May 2023 01:47:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683190041; x=1685782041; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7DuAWKNhB/wDTZm+/wP0YESxwF//9mugxoNSDzEnbF4=; b=DTsLXiz7ByWXI+rO2SoT8JluDfZxz0Nq5XCKsUMIWr3uj1wUnH/vBb0hUK/vBmo5mX ySH3IW7tJ22BzQb4HrKSAkWpMYi0z4oNAKcE5AXf0Y7zpATy9n4RShDRyhORz1mxVu1E Qgku3rwHfvbPpYBhsXD0xF3L5a6t7qDGjNMnno06/pmCQaz8rFqT7+3iY5V1C5I5aHqV 9kb+MGtWJqVm7A9Jyj00r8fmV8qRvsm1dXR+Hg1ZL4UzKqa+G2tCc2fP1ltto1ItkUrH B9ZyDjHnF64DL2d1sPjxmkTQoaG2366xqVhozWVR5jdxtiADYc6Z3Kc4fWtFqQJAxtH8 hhjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683190041; x=1685782041; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7DuAWKNhB/wDTZm+/wP0YESxwF//9mugxoNSDzEnbF4=; b=EdyEHwW/x5vlqGC9EYJXMMS+Ykq1nOo7a+uL9qS1UDopeV7VIf1I8DAmAx61lfToJQ pZJ6kLmTluPyhKonAbIr2bYsdwnH8geg6WyNwIoyrvz4yAqnsrk+O7/nG8yPOx4WFpDP mFIaJrw5Wj9WzWUwQFxUjs1+2GiIxVJoq5BTeO19FyPdk0lHvh5Z/K4OTyW8YpLjzZrT tijFnb8daj7f48IJIpxzz7XSRNuKYh8k78pQjua4efnqwQ8TRNMBkISosV1FdY1SO1yg WbB6k8amuRD06wxWCAd+YpQs/8KhZGOG72CLkw16UDyPSaawZScFY7lgHwwJTmHQfQk4 ny4A== X-Gm-Message-State: AC+VfDwLXPRBpAyB9M7oG3snCeUnoe3N89ANwxhH+2ANotxe+pX0SRL/ KzYcWwvIENtBRetx6k2YSyaQq+kefEQu1ppeF6s= X-Google-Smtp-Source: ACHHUZ6zrQZlYdsiO+40LCooqZx3jJCoejEPqniyVglBJEGc1Ghc8EyUPcbSqKvrohpWxI5d68FMuTkyS92OWV7Wsc0= X-Received: by 2002:a1f:5f51:0:b0:440:65a5:332a with SMTP id t78-20020a1f5f51000000b0044065a5332amr7774061vkb.5.1683190040801; Thu, 04 May 2023 01:47:20 -0700 (PDT) MIME-Version: 1.0 References: <20230502135045.3541570-1-jerinj@marvell.com> <20230502135045.3541570-2-jerinj@marvell.com> In-Reply-To: From: Jerin Jacob Date: Thu, 4 May 2023 14:16:54 +0530 Message-ID: Subject: Re: [dpdk-dev] [PATCH v1] examples/ntb: fix build issue with GCC 13 To: "Guo, Junfeng" Cc: "jerinj@marvell.com" , "dev@dpdk.org" , "Wu, Jingjing" , "Li, Xiaoyun" , "thomas@monjalon.net" , "david.marchand@redhat.com" , "ferruh.yigit@xilinx.com" , "stephen@networkplumber.org" , "stable@dpdk.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Thu, May 4, 2023 at 2:06=E2=80=AFPM Guo, Junfeng = wrote: > > > > > -----Original Message----- > > From: jerinj@marvell.com > > Sent: Tuesday, May 2, 2023 21:51 > > To: dev@dpdk.org; Wu, Jingjing ; Guo, Junfeng > > ; Li, Xiaoyun > > Cc: thomas@monjalon.net; david.marchand@redhat.com; > > ferruh.yigit@xilinx.com; stephen@networkplumber.org; Jerin Jacob > > ; stable@dpdk.org > > Subject: [dpdk-dev] [PATCH v1] examples/ntb: fix build issue with GCC 1= 3 > > > > From: Jerin Jacob > > > > Fix the following build issue by not allowing nb_ids to be zero. > > nb_ids can be zero based on rte_rawdev_xstats_get() API > > documentation but it is not valid for the case when second > > argument is NULL. > > Is this the new standard for GCC 13? No. Looks like optimization from compiler. It is able to detect their case for zero memory allocation. > > > > > examples/ntb/ntb_fwd.c: In function 'ntb_stats_display': > > examples/ntb/ntb_fwd.c:945:23: error: 'rte_rawdev_xstats_get' > > accessing 8 bytes in a region of size 0 [-Werror=3Dstringop-overflow=3D= ] > > 945 | if (nb_ids !=3D rte_rawdev_xstats_get(dev_id, ids, values, nb_i= ds)) { > > | > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > examples/ntb/ntb_fwd.c:945:23: note: referencing argument 3 > > of type 'uint64_t[0]' {aka 'long unsigned int[]'} > > In file included from ../examples/ntb/ntb_fwd.c:17: > > lib/rawdev/rte_rawdev.h:504:1: note: in a call to function > > 'rte_rawdev_xstats_get' > > 504 | rte_rawdev_xstats_get(uint16_t dev_id, > > > > Fixes: 5194299d6ef5 ("examples/ntb: support more functions") > > Cc: stable@dpdk.org > > Signed-off-by: Jerin Jacob > > --- > > examples/ntb/ntb_fwd.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/examples/ntb/ntb_fwd.c b/examples/ntb/ntb_fwd.c > > index f9abed28e4..5489c3b3cd 100644 > > --- a/examples/ntb/ntb_fwd.c > > +++ b/examples/ntb/ntb_fwd.c > > @@ -923,7 +923,7 @@ ntb_stats_display(void) > > > > /* Get NTB dev stats and stats names */ > > nb_ids =3D rte_rawdev_xstats_names_get(dev_id, NULL, 0); > > - if (nb_ids < 0) { > > + if (nb_ids <=3D 0) { > > Should the one in func ntb_stats_clear also be updated non-zero? Some reason compiler is not detecting it. I will fix in next version. > > > printf("Error: Cannot get count of xstats\n"); > > return; > > } > > -- > > 2.40.1 >