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 224D4A0503 for ; Fri, 1 Apr 2022 10:16:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 06D294014F; Fri, 1 Apr 2022 10:16:28 +0200 (CEST) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by mails.dpdk.org (Postfix) with ESMTP id EE47A4014F for ; Fri, 1 Apr 2022 10:16:26 +0200 (CEST) Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id B90A03F812 for ; Fri, 1 Apr 2022 08:16:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1648800986; bh=HvRorvwwNBywu05lTqSei1XCbv7XhOahIVigZPXdvL8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=cTeYWUsnsKO2/DQzaTqj1wj4saUh7S92SaIjFo4a7Cgk+dN3ajbt/e7uFxd2GpbPs 5p+sLSoBTRGq8bxgMKGeOA2KP5u/gI0ZRzrmqO4p3d5P3mSPphkYCMxkU2I3Np1DE8 AL07b9iU4yzLfqD3FjxiJJHtMomKVfLe18xZWnb/IyrMSRi7nfTYhMSFIubGNz/dcf pzL5eTpgO2fNg0FtwD4Ditn8AbByZe1MHCBUnfrQFHI7xJIucg/w/1INubszCRUGXm FVdvkSIXmdfynRsuF0qKavZmjEK0sCQTlgfd9gKbbXwfZXkXD4J3V+by6dWh5erd+p 8afMlvrJCYzUw== Received: by mail-qv1-f72.google.com with SMTP id fw9-20020a056214238900b0043522aa5b81so1466955qvb.21 for ; Fri, 01 Apr 2022 01:16:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HvRorvwwNBywu05lTqSei1XCbv7XhOahIVigZPXdvL8=; b=D+i76arZchDWHpKbYg2RRy8ryCqeJ8lUwaqaRkYxQBjhGbsP2l8iIn6eeA7vPuHbYE LVVlupBlC3qAAIMb+N8t9r0sP4QjiJxaNq0zwV9LdDYOOsz5Lmwu3FjIgqwh3sTIiVyM hjT+4vgYpzIx2udM3qKqMMJiN/GBLy2BJ3q65Kng9WHbgv6xah97ZExjW4ogbHqcS7GZ mMIPFMkoBP2/nKAz6xAe6ZfvXIOr/xzHxWGJAh9I/O+MzMV+K6n3CamzQgiUfuDUMJ+p BlFksutCtUQpPKixmeGEcIRzFOQ/5QwrcIAaNP/hJjIKS5dFQausedCb7N56J0u/8ie+ nLVw== X-Gm-Message-State: AOAM530wbGHf8GZsEp6WKiNQei39usMEucM0oPlmCeFQxGhB0F27GJTn YyfhJx+Rn7+SbB9VlxWApefEQyMY/QC1NckTDloxZuyOURESU1lhUDcsRH6OihsSetP7hoPYVF4 kbu4vH59bI/Ja44AI7Z6WvWg5FW80ugMPOzYz7Myf X-Received: by 2002:a05:6214:2b07:b0:432:f7e6:e443 with SMTP id jx7-20020a0562142b0700b00432f7e6e443mr7185599qvb.125.1648800985546; Fri, 01 Apr 2022 01:16:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzP3d8pHsyHAyn2GlAFCJFIQTAnsyaB4NUr2KkRSZj1YgQUaAq6KRxjnagfti0uo7OBfiQF7SYRtSXQRgZcrik= X-Received: by 2002:a05:6214:2b07:b0:432:f7e6:e443 with SMTP id jx7-20020a0562142b0700b00432f7e6e443mr7185591qvb.125.1648800985347; Fri, 01 Apr 2022 01:16:25 -0700 (PDT) MIME-Version: 1.0 References: <20220330121225.322838-1-luca.boccassi@gmail.com> <20220330141213.349257-1-luca.boccassi@gmail.com> In-Reply-To: <20220330141213.349257-1-luca.boccassi@gmail.com> From: Christian Ehrhardt Date: Fri, 1 Apr 2022 10:15:59 +0200 Message-ID: Subject: Re: [PATCH 19.11 20.11 v2] pmdinfogen: fix compilation with Clang 3.4.2 on CentOS 7 To: luca.boccassi@gmail.com Cc: stable@dpdk.org, Luca Boccassi Content-Type: multipart/alternative; boundary="000000000000098fb405db9365bb" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org --000000000000098fb405db9365bb Content-Type: text/plain; charset="UTF-8" On Wed, Mar 30, 2022 at 4:12 PM wrote: > From: Luca Boccassi > > $ meson --werror --buildtype=debugoptimized build && ninja-build -C build > [..] > [5/2516] Compiling C object > buildtools/pmdinfogen/pmdinfogen.p/pmdinfogen.c.o > FAILED: buildtools/pmdinfogen/pmdinfogen.p/pmdinfogen.c.o > clang -Ibuildtools/pmdinfogen/pmdinfogen.p -Ibuildtools/pmdinfogen > -I../../root/dpdk/buildtools/pmdinfogen -I. -I../../root/dpdk -Iconfig > -I../../root/dpdk/config -Ilib/librte_eal/include > -I../../root/dpdk/lib/librte_eal/include -Ilib/librte_eal/linux/include > -I../../root/dpdk/lib/librte_eal/linux/include -Ilib/librte_eal/x86/include > -I../../root/dpdk/lib/librte_eal/x86/include -Ilib/librte_pci > -I../../root/dpdk/lib/librte_pci -Xclang -fcolor-diagnostics -pipe > -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -O2 -g -MD -MQ > buildtools/pmdinfogen/pmdinfogen.p/pmdinfogen.c.o -MF > buildtools/pmdinfogen/pmdinfogen.p/pmdinfogen.c.o.d -o > buildtools/pmdinfogen/pmdinfogen.p/pmdinfogen.c.o -c > ../../root/dpdk/buildtools/pmdinfogen/pmdinfogen.c > ../../root/dpdk/buildtools/pmdinfogen/pmdinfogen.c:431:27: error: missing > field 'hdr' initializer [-Werror,-Wmissing-field-initializers] > struct elf_info info = {0}; > ^ > 1 error generated. > [..] > > Use memset instead. > > Bugzilla ID: 984 > > Fixes: 0decf84217f1 ("buildtools: zero elf info variable in pmdinfogen") > Works fine for me across distributions/architectures, applied replacing the v1 > Signed-off-by: Luca Boccassi > Reviewed-by: Christian Ehrhardt > --- > structured init broke old gcc 4, switch to memset > > buildtools/pmdinfogen/pmdinfogen.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/buildtools/pmdinfogen/pmdinfogen.c > b/buildtools/pmdinfogen/pmdinfogen.c > index a68d1ea999..f7133267be 100644 > --- a/buildtools/pmdinfogen/pmdinfogen.c > +++ b/buildtools/pmdinfogen/pmdinfogen.c > @@ -428,7 +428,7 @@ static void output_pmd_info_string(struct elf_info > *info, char *outfile) > > int main(int argc, char **argv) > { > - struct elf_info info = {0}; > + struct elf_info info; > int rc = 1; > > if (argc < 3) { > @@ -437,6 +437,7 @@ int main(int argc, char **argv) > basename(argv[0])); > exit(127); > } > + memset(&info, 0, sizeof(struct elf_info)); > use_stdin = !strcmp(argv[1], "-"); > use_stdout = !strcmp(argv[2], "-"); > parse_elf(&info, argv[1]); > -- > 2.34.1 > > -- Christian Ehrhardt Staff Engineer, Ubuntu Server Canonical Ltd --000000000000098fb405db9365bb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Mar 30, 2022 at 4:12 PM <<= a href=3D"mailto:luca.boccassi@gmail.com">luca.boccassi@gmail.com> w= rote:
From: Luca= Boccassi <bluca@d= ebian.org>

$ meson --werror --buildtype=3Ddebugoptimized build && ninja-build = -C build
[..]
[5/2516] Compiling C object buildtools/pmdinfogen/pmdinfogen.p/pmdinfogen.c= .o
FAILED: buildtools/pmdinfogen/pmdinfogen.p/pmdinfogen.c.o
clang -Ibuildtools/pmdinfogen/pmdinfogen.p -Ibuildtools/pmdinfogen -I../../= root/dpdk/buildtools/pmdinfogen -I. -I../../root/dpdk -Iconfig -I../../root= /dpdk/config -Ilib/librte_eal/include -I../../root/dpdk/lib/librte_eal/incl= ude -Ilib/librte_eal/linux/include -I../../root/dpdk/lib/librte_eal/linux/i= nclude -Ilib/librte_eal/x86/include -I../../root/dpdk/lib/librte_eal/x86/in= clude -Ilib/librte_pci -I../../root/dpdk/lib/librte_pci -Xclang -fcolor-dia= gnostics -pipe -D_FILE_OFFSET_BITS=3D64 -Wall -Winvalid-pch -Wextra -Werror= -O2 -g -MD -MQ buildtools/pmdinfogen/pmdinfogen.p/pmdinfogen.c.o -MF build= tools/pmdinfogen/pmdinfogen.p/pmdinfogen.c.o.d -o buildtools/pmdinfogen/pmd= infogen.p/pmdinfogen.c.o -c ../../root/dpdk/buildtools/pmdinfogen/pmdinfoge= n.c
../../root/dpdk/buildtools/pmdinfogen/pmdinfogen.c:431:27: error: missing f= ield 'hdr' initializer [-Werror,-Wmissing-field-initializers]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct elf_info info =3D {0};
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^
1 error generated.
[..]

Use memset instead.

Bugzilla ID: 984

Fixes: 0decf84217f1 ("buildtools: zero elf info variable in pmdinfogen= ")

Works fine for me across distri= butions/architectures, applied replacing the v1
=C2=A0
Signed-off-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
---
structured init broke old gcc 4, switch to memset

=C2=A0buildtools/pmdinfogen/pmdinfogen.c | 3 ++-
=C2=A01 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/buildtools/pmdinfogen/pmdinfogen.c b/buildtools/pmdinfogen/pmd= infogen.c
index a68d1ea999..f7133267be 100644
--- a/buildtools/pmdinfogen/pmdinfogen.c
+++ b/buildtools/pmdinfogen/pmdinfogen.c
@@ -428,7 +428,7 @@ static void output_pmd_info_string(struct elf_info *inf= o, char *outfile)

=C2=A0int main(int argc, char **argv)
=C2=A0{
-=C2=A0 =C2=A0 =C2=A0 =C2=A0struct elf_info info =3D {0};
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct elf_info info;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 int rc =3D 1;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (argc < 3) {
@@ -437,6 +437,7 @@ int main(int argc, char **argv)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 basename(argv[0]));
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 exit(127);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+=C2=A0 =C2=A0 =C2=A0 =C2=A0memset(&info, 0, sizeof(struct elf_info));<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 use_stdin =3D !strcmp(argv[1], "-");<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 use_stdout =3D !strcmp(argv[2], "-");=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 parse_elf(&info, argv[1]);
--
2.34.1



--
Christian Ehrhardt
Staff Engineer, Ubuntu Ser= ver
Canonical Ltd
--000000000000098fb405db9365bb--