<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 30, 2022 at 4:12 PM <<a href="mailto:luca.boccassi@gmail.com">luca.boccassi@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: Luca Boccassi <<a href="mailto:bluca@debian.org" target="_blank">bluca@debian.org</a>><br>
<br>
$ meson --werror --buildtype=debugoptimized build && ninja-build -C build<br>
[..]<br>
[5/2516] Compiling C object buildtools/pmdinfogen/pmdinfogen.p/pmdinfogen.c.o<br>
FAILED: buildtools/pmdinfogen/pmdinfogen.p/pmdinfogen.c.o<br>
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<br>
../../root/dpdk/buildtools/pmdinfogen/pmdinfogen.c:431:27: error: missing field 'hdr' initializer [-Werror,-Wmissing-field-initializers]<br>
struct elf_info info = {0};<br>
^<br>
1 error generated.<br>
[..]<br>
<br>
Use memset instead.<br>
<br>
Bugzilla ID: 984<br>
<br>
Fixes: 0decf84217f1 ("buildtools: zero elf info variable in pmdinfogen")<br></blockquote><div><br></div><div>Works fine for me across distributions/architectures, applied replacing the v1</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Signed-off-by: Luca Boccassi <<a href="mailto:bluca@debian.org" target="_blank">bluca@debian.org</a>><br>
Reviewed-by: Christian Ehrhardt <<a href="mailto:christian.ehrhardt@canonical.com" target="_blank">christian.ehrhardt@canonical.com</a>><br>
---<br>
structured init broke old gcc 4, switch to memset<br>
<br>
buildtools/pmdinfogen/pmdinfogen.c | 3 ++-<br>
1 file changed, 2 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/buildtools/pmdinfogen/pmdinfogen.c b/buildtools/pmdinfogen/pmdinfogen.c<br>
index a68d1ea999..f7133267be 100644<br>
--- a/buildtools/pmdinfogen/pmdinfogen.c<br>
+++ b/buildtools/pmdinfogen/pmdinfogen.c<br>
@@ -428,7 +428,7 @@ static void output_pmd_info_string(struct elf_info *info, char *outfile)<br>
<br>
int main(int argc, char **argv)<br>
{<br>
- struct elf_info info = {0};<br>
+ struct elf_info info;<br>
int rc = 1;<br>
<br>
if (argc < 3) {<br>
@@ -437,6 +437,7 @@ int main(int argc, char **argv)<br>
basename(argv[0]));<br>
exit(127);<br>
}<br>
+ memset(&info, 0, sizeof(struct elf_info));<br>
use_stdin = !strcmp(argv[1], "-");<br>
use_stdout = !strcmp(argv[2], "-");<br>
parse_elf(&info, argv[1]);<br>
-- <br>
2.34.1<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Christian Ehrhardt<br>Staff Engineer, Ubuntu Server<br>Canonical Ltd</div></div>