netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* GCC 12 warnings
@ 2022-05-20  2:36 Jakub Kicinski
  2022-05-20 16:46 ` Kees Cook
  0 siblings, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2022-05-20  2:36 UTC (permalink / raw)
  To: Kees Cook; +Cc: netdev

Hi Kees,

I'm sure you're involved in a number of glorious GCC 12 conversations..

We have a handful of drivers in networking which get hit by
-Warray-bounds because they allocate partial structures (I presume 
to save memory, misguided but more than 15min of work to refactor).

Since -Warray-bounds is included by default now this is making our
lives a little hard [1]. Is there a wider effort to address this?
If not do you have a recommendation on how to deal with it?

My best idea is to try to isolate the bad files and punt -Warray-bounds
to W=1 for those, so we can prevent more of them getting in but not
break WERROR builds on GCC 12. That said, I'm not sure how to achieve
that.. This for example did not work:

--- a/drivers/net/ethernet/mediatek/Makefile
+++ b/drivers/net/ethernet/mediatek/Makefile
@@ -9,5 +9,9 @@ mtk_eth-$(CONFIG_NET_MEDIATEK_SOC_WED) += mtk_wed.o
 ifdef CONFIG_DEBUG_FS
 mtk_eth-$(CONFIG_NET_MEDIATEK_SOC_WED) += mtk_wed_debugfs.o
 endif
 obj-$(CONFIG_NET_MEDIATEK_SOC_WED) += mtk_wed_ops.o
 obj-$(CONFIG_NET_MEDIATEK_STAR_EMAC) += mtk_star_emac.o
+
+ifneq ($(findstring 1, $(KBUILD_EXTRA_WARN)),)
+CFLAGS_mtk_ppe.o += -Wno-array-bounds
+endif

[1]
https://lore.kernel.org/all/20220520012555.2262461-1-kuba@kernel.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-20 23:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-20  2:36 GCC 12 warnings Jakub Kicinski
2022-05-20 16:46 ` Kees Cook
2022-05-20 17:23   ` Jakub Kicinski
2022-05-20 21:43     ` David Laight
2022-05-20 23:30       ` Kees Cook

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).