* [PATCH 19.11 20.11] pmdinfogen: fix compilation with Clang 3.4.2 on CentOS 7
@ 2022-03-30 12:12 luca.boccassi
2022-03-30 12:51 ` Christian Ehrhardt
2022-03-30 14:12 ` [PATCH 19.11 20.11 v2] " luca.boccassi
0 siblings, 2 replies; 4+ messages in thread
From: luca.boccassi @ 2022-03-30 12:12 UTC (permalink / raw)
To: stable; +Cc: christian.ehrhardt, Luca Boccassi
From: Luca Boccassi <bluca@debian.org>
$ 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 structured initialization
Bugzilla ID: 984
Signed-off-by: Luca Boccassi <bluca@debian.org>
---
buildtools/pmdinfogen/pmdinfogen.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/buildtools/pmdinfogen/pmdinfogen.c b/buildtools/pmdinfogen/pmdinfogen.c
index a68d1ea999..534ed9f3c8 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) {
--
2.34.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 19.11 20.11] pmdinfogen: fix compilation with Clang 3.4.2 on CentOS 7
2022-03-30 12:12 [PATCH 19.11 20.11] pmdinfogen: fix compilation with Clang 3.4.2 on CentOS 7 luca.boccassi
@ 2022-03-30 12:51 ` Christian Ehrhardt
2022-03-30 14:12 ` [PATCH 19.11 20.11 v2] " luca.boccassi
1 sibling, 0 replies; 4+ messages in thread
From: Christian Ehrhardt @ 2022-03-30 12:51 UTC (permalink / raw)
To: luca.boccassi; +Cc: stable, Luca Boccassi
On Wed, Mar 30, 2022 at 2:13 PM <luca.boccassi@gmail.com> wrote:
>
> From: Luca Boccassi <bluca@debian.org>
>
> $ 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.
> [..]
The change itself LGTM and works on my end for 19.11 (applied it).
Maybe adding a fixes: 0decf84217f1ef8af132948a0661559a96961495 ?
With or without it is fine,
Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
> Use structured initialization
>
> Bugzilla ID: 984
>
> Signed-off-by: Luca Boccassi <bluca@debian.org>
> ---
> buildtools/pmdinfogen/pmdinfogen.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/buildtools/pmdinfogen/pmdinfogen.c b/buildtools/pmdinfogen/pmdinfogen.c
> index a68d1ea999..534ed9f3c8 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) {
> --
> 2.34.1
>
--
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 19.11 20.11 v2] pmdinfogen: fix compilation with Clang 3.4.2 on CentOS 7
2022-03-30 12:12 [PATCH 19.11 20.11] pmdinfogen: fix compilation with Clang 3.4.2 on CentOS 7 luca.boccassi
2022-03-30 12:51 ` Christian Ehrhardt
@ 2022-03-30 14:12 ` luca.boccassi
2022-04-01 8:15 ` Christian Ehrhardt
1 sibling, 1 reply; 4+ messages in thread
From: luca.boccassi @ 2022-03-30 14:12 UTC (permalink / raw)
To: stable; +Cc: christian.ehrhardt, Luca Boccassi
From: Luca Boccassi <bluca@debian.org>
$ 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")
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
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 19.11 20.11 v2] pmdinfogen: fix compilation with Clang 3.4.2 on CentOS 7
2022-03-30 14:12 ` [PATCH 19.11 20.11 v2] " luca.boccassi
@ 2022-04-01 8:15 ` Christian Ehrhardt
0 siblings, 0 replies; 4+ messages in thread
From: Christian Ehrhardt @ 2022-04-01 8:15 UTC (permalink / raw)
To: luca.boccassi; +Cc: stable, Luca Boccassi
[-- Attachment #1: Type: text/plain, Size: 2717 bytes --]
On Wed, Mar 30, 2022 at 4:12 PM <luca.boccassi@gmail.com> wrote:
> From: Luca Boccassi <bluca@debian.org>
>
> $ 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 <bluca@debian.org>
> Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
> ---
> 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
[-- Attachment #2: Type: text/html, Size: 3739 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-04-01 8:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-30 12:12 [PATCH 19.11 20.11] pmdinfogen: fix compilation with Clang 3.4.2 on CentOS 7 luca.boccassi
2022-03-30 12:51 ` Christian Ehrhardt
2022-03-30 14:12 ` [PATCH 19.11 20.11 v2] " luca.boccassi
2022-04-01 8:15 ` Christian Ehrhardt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).