* [LTP] [PATCH] config.mk.in: build.sh: Add -Wno-missing-field-initializers to CFLAGS
@ 2022-12-08 13:03 Zhao Gongyi via ltp
2022-12-08 13:24 ` Cyril Hrubis
0 siblings, 1 reply; 5+ messages in thread
From: Zhao Gongyi via ltp @ 2022-12-08 13:03 UTC (permalink / raw)
To: ltp
Add CFLAGS -Wno-missing-field-initializers to suppress the
compilation warnings like:
autogroup01.c:87:1: warning: missing initializer for field ‘needs_cmds’ of ‘struct tst_test’ [-Wmissing-field-initializers]
};
^
In file included from autogroup01.c:21:0:
../../../../include/tst_test.h:324:21: note: ‘needs_cmds’ declared here
const char *const *needs_cmds;
^~~~~~~~~~
Signed-off-by: Zhao Gongyi <zhaogongyi@huawei.com>
---
build.sh | 2 +-
include/mk/config.mk.in | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/build.sh b/build.sh
index 1767cc21b..176701024 100755
--- a/build.sh
+++ b/build.sh
@@ -4,7 +4,7 @@
set -e
-CFLAGS="${CFLAGS:--Wformat -Werror=format-security -Werror=implicit-function-declaration -Werror=return-type -fno-common}"
+CFLAGS="${CFLAGS:--Wformat -Werror=format-security -Werror=implicit-function-declaration -Werror=return-type -fno-common -Wno-missing-field-initializers}"
CC="${CC:-gcc}"
DEFAULT_PREFIX="$HOME/ltp-install"
diff --git a/include/mk/config.mk.in b/include/mk/config.mk.in
index 22301e126..6712bf215 100644
--- a/include/mk/config.mk.in
+++ b/include/mk/config.mk.in
@@ -76,7 +76,7 @@ LDFLAGS := @LDFLAGS@
DEBUG_CFLAGS ?= -g
# for -fstrict-aliasing see doc/build-system-guide.txt
-OPT_CFLAGS ?= -O2 -fno-strict-aliasing -pipe
+OPT_CFLAGS ?= -O2 -fno-strict-aliasing -pipe -Wno-missing-field-initializers
WCFLAGS ?= -Wall -W @GCC_WARN_OLDSTYLE@
--
2.17.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] config.mk.in: build.sh: Add -Wno-missing-field-initializers to CFLAGS
2022-12-08 13:03 [LTP] [PATCH] config.mk.in: build.sh: Add -Wno-missing-field-initializers to CFLAGS Zhao Gongyi via ltp
@ 2022-12-08 13:24 ` Cyril Hrubis
2022-12-08 14:55 ` Petr Vorel
0 siblings, 1 reply; 5+ messages in thread
From: Cyril Hrubis @ 2022-12-08 13:24 UTC (permalink / raw)
To: Zhao Gongyi; +Cc: ltp
Hi!
> Add CFLAGS -Wno-missing-field-initializers to suppress the
> compilation warnings like:
>
> autogroup01.c:87:1: warning: missing initializer for field ‘needs_cmds’ of ‘struct tst_test’ [-Wmissing-field-initializers]
> };
> ^
> In file included from autogroup01.c:21:0:
> ../../../../include/tst_test.h:324:21: note: ‘needs_cmds’ declared here
> const char *const *needs_cmds;
This is actually caused by a gcc bug that has been already fixed see:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84685
And I do not think that it's a good idea to work around gcc warnings in
our build system.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] config.mk.in: build.sh: Add -Wno-missing-field-initializers to CFLAGS
2022-12-08 13:24 ` Cyril Hrubis
@ 2022-12-08 14:55 ` Petr Vorel
0 siblings, 0 replies; 5+ messages in thread
From: Petr Vorel @ 2022-12-08 14:55 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
> Hi!
> > Add CFLAGS -Wno-missing-field-initializers to suppress the
> > compilation warnings like:
> > autogroup01.c:87:1: warning: missing initializer for field ‘needs_cmds’ of ‘struct tst_test’ [-Wmissing-field-initializers]
> > };
> > ^
> > In file included from autogroup01.c:21:0:
> > ../../../../include/tst_test.h:324:21: note: ‘needs_cmds’ declared here
> > const char *const *needs_cmds;
> This is actually caused by a gcc bug that has been already fixed see:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84685
> And I do not think that it's a good idea to work around gcc warnings in
> our build system.
I would not workaround it either.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] config.mk.in: build.sh: Add -Wno-missing-field-initializers to CFLAGS
@ 2022-12-09 1:08 zhaogongyi via ltp
2022-12-09 9:50 ` Petr Vorel
0 siblings, 1 reply; 5+ messages in thread
From: zhaogongyi via ltp @ 2022-12-09 1:08 UTC (permalink / raw)
To: Cyril Hrubis, Petr Vorel; +Cc: ltp@lists.linux.it
Hi!
>
> Hi!
> > Add CFLAGS -Wno-missing-field-initializers to suppress the compilation
> > warnings like:
> >
> > autogroup01.c:87:1: warning: missing initializer for field
> > ‘needs_cmds’ of ‘struct tst_test’ [-Wmissing-field-initializers] };
> > ^ In file included from autogroup01.c:21:0:
> > ../../../../include/tst_test.h:324:21: note: ‘needs_cmds’ declared here
> > const char *const *needs_cmds;
>
> This is actually caused by a gcc bug that has been already fixed see:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84685
Thank you for your notice.
>
> And I do not think that it's a good idea to work around gcc warnings in our
> build system.
>
I haven't paid attention to other warning messages now. Maybe they should be ignored as well.
Regards,
Gongyi
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] config.mk.in: build.sh: Add -Wno-missing-field-initializers to CFLAGS
2022-12-09 1:08 zhaogongyi via ltp
@ 2022-12-09 9:50 ` Petr Vorel
0 siblings, 0 replies; 5+ messages in thread
From: Petr Vorel @ 2022-12-09 9:50 UTC (permalink / raw)
To: zhaogongyi; +Cc: ltp@lists.linux.it
> Hi!
> > Hi!
> > > Add CFLAGS -Wno-missing-field-initializers to suppress the compilation
> > > warnings like:
> > > autogroup01.c:87:1: warning: missing initializer for field
> > > ‘needs_cmds’ of ‘struct tst_test’ [-Wmissing-field-initializers] };
> > > ^ In file included from autogroup01.c:21:0:
> > > ../../../../include/tst_test.h:324:21: note: ‘needs_cmds’ declared here
> > > const char *const *needs_cmds;
> > This is actually caused by a gcc bug that has been already fixed see:
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84685
> Thank you for your notice.
> > And I do not think that it's a good idea to work around gcc warnings in our
> > build system.
It's just matter of time when old gcc passes away.
> I haven't paid attention to other warning messages now. Maybe they should be ignored as well.
Most of the warnings are valid and should be fixed. That takes time, but we all
slowly work on it. Anyway, warning are here for a reason, I prefer to have false
positives than lost valid warning.
Kind regards,
Petr
> Regards,
> Gongyi
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-12-09 9:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-08 13:03 [LTP] [PATCH] config.mk.in: build.sh: Add -Wno-missing-field-initializers to CFLAGS Zhao Gongyi via ltp
2022-12-08 13:24 ` Cyril Hrubis
2022-12-08 14:55 ` Petr Vorel
-- strict thread matches above, loose matches on Subject: below --
2022-12-09 1:08 zhaogongyi via ltp
2022-12-09 9:50 ` Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox