* [dpdk-dev] [PATCH] mk: disable flag for no packet member warning
@ 2019-07-22 12:39 kkanas
2019-07-22 13:44 ` Bruce Richardson
0 siblings, 1 reply; 4+ messages in thread
From: kkanas @ 2019-07-22 12:39 UTC (permalink / raw)
To: dev, Thomas Monjalon; +Cc: Krzysztof Kanas, reshma.pattan
From: Krzysztof Kanas <kkanas@marvell.com>
gcc prior 9 don't will add additional warning for unrecognized command
line option, but only when there is some other warning in the code, e.g
unused variable.
Fixes: a385972c3675 ("mk: disable warning for packed member pointer")
Cc: reshma.pattan@intel.com
Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
---
mk/toolchain/gcc/rte.vars.mk | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
index b852fcfd7e24..1bd384f7ca3f 100644
--- a/mk/toolchain/gcc/rte.vars.mk
+++ b/mk/toolchain/gcc/rte.vars.mk
@@ -88,7 +88,9 @@ WERROR_FLAGS += -Wno-format-truncation
endif
# disable packed member unalign warnings
+ifeq ($(shell test $(HOST_GCC_VERSION) -gt 90 && echo 1), 1)
WERROR_FLAGS += -Wno-address-of-packed-member
+endif
export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
--
2.21.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] mk: disable flag for no packet member warning
2019-07-22 12:39 [dpdk-dev] [PATCH] mk: disable flag for no packet member warning kkanas
@ 2019-07-22 13:44 ` Bruce Richardson
2019-07-23 9:05 ` [dpdk-dev] [EXT] " Krzysztof Kanas
0 siblings, 1 reply; 4+ messages in thread
From: Bruce Richardson @ 2019-07-22 13:44 UTC (permalink / raw)
To: kkanas; +Cc: dev, Thomas Monjalon, reshma.pattan
On Mon, Jul 22, 2019 at 02:39:59PM +0200, kkanas@marvell.com wrote:
> From: Krzysztof Kanas <kkanas@marvell.com>
>
> gcc prior 9 don't will add additional warning for unrecognized command
> line option, but only when there is some other warning in the code, e.g
> unused variable.
>
I don't think this behaviour has changed in gcc 9. I just did a test
compile with gcc 9.1, and no warning was printed for flag
"-Wno-random-warnings". The online docs also make no mention of this
behaviour being conditional on GCC version [1].
/Bruce
[1] https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [EXT] Re: [PATCH] mk: disable flag for no packet member warning
2019-07-22 13:44 ` Bruce Richardson
@ 2019-07-23 9:05 ` Krzysztof Kanas
2019-07-23 13:18 ` Bruce Richardson
0 siblings, 1 reply; 4+ messages in thread
From: Krzysztof Kanas @ 2019-07-23 9:05 UTC (permalink / raw)
To: Bruce Richardson; +Cc: Krzysztof Kanas, dev, Thomas Monjalon, reshma.pattan
On 19-07-22 14:44, Bruce Richardson wrote:
> External Email
>
> ----------------------------------------------------------------------
> On Mon, Jul 22, 2019 at 02:39:59PM +0200, kkanas@marvell.com wrote:
> > From: Krzysztof Kanas <kkanas@marvell.com>
> >
> > gcc prior 9 don't will add additional warning for unrecognized command
> > line option, but only when there is some other warning in the code, e.g
> > unused variable.
> >
> I don't think this behaviour has changed in gcc 9. I just did a test
> compile with gcc 9.1, and no warning was printed for flag
> "-Wno-random-warnings". The online docs also make no mention of this
> behaviour being conditional on GCC version [1].
GCC changelog show that from 9.0 -Waddress-of-packed-member was added
[1].
Test shows me that GCC prior to 9.0 won't complain about this flag, but
in case of other warnings in file GCC will complain, e.g.,
cat > a.c
int main(int argc, char **argv)
{
int a;
return 0;
}
# gcc -Wall -Wno-address-of-packed-member a.c
a.c: In function ‘main’:
a.c:3:6: warning: unused variable ‘a’ [-Wunused-variable]
int a;
^
a.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-address-of-packed-member’
But when line `int a;' is removed then no warning is issued.
Also I detected this, due to difference with meson build. Meson checks
if compiler supports this flag and will not issue
-Wno-address-of-packed-member to compiler.
>
> /Bruce
>
> [1] https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
[1] https://gcc.gnu.org/gcc-9/changes.html
--
-
Regards,
Krzysztof(Chris) Kanas
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [EXT] Re: [PATCH] mk: disable flag for no packet member warning
2019-07-23 9:05 ` [dpdk-dev] [EXT] " Krzysztof Kanas
@ 2019-07-23 13:18 ` Bruce Richardson
0 siblings, 0 replies; 4+ messages in thread
From: Bruce Richardson @ 2019-07-23 13:18 UTC (permalink / raw)
To: Krzysztof Kanas; +Cc: dev, Thomas Monjalon, reshma.pattan
On Tue, Jul 23, 2019 at 09:05:50AM +0000, Krzysztof Kanas wrote:
> On 19-07-22 14:44, Bruce Richardson wrote:
> > External Email
> >
> > ----------------------------------------------------------------------
> > On Mon, Jul 22, 2019 at 02:39:59PM +0200, kkanas@marvell.com wrote:
> > > From: Krzysztof Kanas <kkanas@marvell.com>
> > >
> > > gcc prior 9 don't will add additional warning for unrecognized command
> > > line option, but only when there is some other warning in the code, e.g
> > > unused variable.
> > >
> > I don't think this behaviour has changed in gcc 9. I just did a test
> > compile with gcc 9.1, and no warning was printed for flag
> > "-Wno-random-warnings". The online docs also make no mention of this
> > behaviour being conditional on GCC version [1].
> GCC changelog show that from 9.0 -Waddress-of-packed-member was added
> [1].
>
> Test shows me that GCC prior to 9.0 won't complain about this flag, but
> in case of other warnings in file GCC will complain, e.g.,
>
> cat > a.c
> int main(int argc, char **argv)
> {
> int a;
> return 0;
> }
>
> # gcc -Wall -Wno-address-of-packed-member a.c
>
> a.c: In function ‘main’:
> a.c:3:6: warning: unused variable ‘a’ [-Wunused-variable]
> int a;
> ^
> a.c: At top level:
> cc1: warning: unrecognized command line option ‘-Wno-address-of-packed-member’
>
> But when line `int a;' is removed then no warning is issued.
>
> Also I detected this, due to difference with meson build. Meson checks
> if compiler supports this flag and will not issue
> -Wno-address-of-packed-member to compiler.
>
Yes, all that is correct, but there is no behaviour change in GCC 9. This
does not require a fix IMHO.
/Bruce
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-07-23 13:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-22 12:39 [dpdk-dev] [PATCH] mk: disable flag for no packet member warning kkanas
2019-07-22 13:44 ` Bruce Richardson
2019-07-23 9:05 ` [dpdk-dev] [EXT] " Krzysztof Kanas
2019-07-23 13:18 ` Bruce Richardson
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).