From: Stephen Rothwell <hidden> Date: 2018-11-25 21:59:43
Hi Kees,
On Fri, 26 Oct 2018 01:34:33 +0100 Kees Cook [off-list ref] wrote:
So, if you it's possible to "seed" some new flags for linux-next, I'd
be interested in making sure no new instances of warnings from
-Wimplicit-fallthrough (gcc 7.1 and later) appear. VLAs will be gone
in a couple days, so I'm currently only interested in killing implicit
fallthroughs[1] now. There are hundreds of cases remaining, so ignore
those on the first build, but anything NEW is what I'd like to get
maintainer nags sent for (CCing myself and Gustavo Silva would be
especially nice, too).
I finally got around to this. I have added the following patch to my
fixes tree (which is merged immediately after Linus' tree).
commit 4d8360ade996cf1823e570544791c9d7bd660ffb
Author: Stephen Rothwell [off-list ref]
Date: Mon Nov 26 07:58:34 2018 +1100
Check for new cases of implict fallthrough
for Kees
Signed-off-by: Stephen Rothwell [off-list ref]
@@ -804,6 +804,9 @@ KBUILD_CFLAGS += -Wdeclaration-after-statement# Variable Length Arrays (VLAs) should not be used anywhere in the kernelKBUILD_CFLAGS+=$(callcc-option,-Wvla)+# Check for implict fallthroughs+KBUILD_CFLAGS+=$(callcc-option,-Wimplicit-fallthrough)+# disable pointer signed / unsigned warnings in gcc 4.0KBUILD_CFLAGS+=-Wno-pointer-sign
Unfortunately, some of the kernel is built with -Werror, so I have had
to add the following patch as well just to build Linus' tree:
(I just marked them as "fall through", I am not sure if that is the
correct resolution.)
From: Stephen Rothwell <redacted>
Date: Mon, 26 Nov 2018 08:32:39 +1100
Subject: [PATCH] powerpc: tag implicit fall throughs
Signed-off-by: Stephen Rothwell <redacted>
---
arch/powerpc/kernel/nvram_64.c | 1 +
arch/powerpc/platforms/powermac/feature.c | 1 +
arch/powerpc/xmon/xmon.c | 1 +
3 files changed, 3 insertions(+)
@@ -809,6 +809,7 @@ static long dev_nvram_ioctl(struct file *file, unsigned int cmd,#ifdef CONFIG_PPC_PMACcaseOBSOLETE_PMAC_NVRAM_GET_OFFSET:printk(KERN_WARNING"nvram: Using obsolete PMAC_NVRAM_GET_OFFSET ioctl\n");+/* fall through */caseIOC_NVRAM_GET_OFFSET:{intpart,offset;
@@ -1471,6 +1471,7 @@ static long g5_i2s_enable(struct device_node *node, long param, long value)case2:if(macio->type==macio_shasta)break;+/* fall through */default:return-ENODEV;}
@@ -4033,6 +4033,7 @@ static int do_spu_cmd(void)subcmd=inchar();if(isxdigit(subcmd)||subcmd=='\n')termch=subcmd;+/* fall through */case'f':scanhex(&num);if(num>=XMON_NUM_SPUS||!spu_info[num].spu){
On Sun, Nov 25, 2018 at 1:48 PM Stephen Rothwell [off-list ref] wrote:
Hi Kees,
On Fri, 26 Oct 2018 01:34:33 +0100 Kees Cook [off-list ref] wrote:
quoted
So, if you it's possible to "seed" some new flags for linux-next, I'd
be interested in making sure no new instances of warnings from
-Wimplicit-fallthrough (gcc 7.1 and later) appear. VLAs will be gone
in a couple days, so I'm currently only interested in killing implicit
fallthroughs[1] now. There are hundreds of cases remaining, so ignore
those on the first build, but anything NEW is what I'd like to get
maintainer nags sent for (CCing myself and Gustavo Silva would be
especially nice, too).
I finally got around to this. I have added the following patch to my
fixes tree (which is merged immediately after Linus' tree).
Excellent! (Though, wait, does this mean everyone _else_ will see this
too? I'm worried that will be way too noisy...)
FYI, I am currently ignoring 659 such warnings in Linus' tree ...
That sound about right. Before Gustavo started there maybe 1000 more. (!) :)
Thanks!
-Kees
quoted hunk
commit 4d8360ade996cf1823e570544791c9d7bd660ffb
Author: Stephen Rothwell [off-list ref]
Date: Mon Nov 26 07:58:34 2018 +1100
Check for new cases of implict fallthrough
for Kees
Signed-off-by: Stephen Rothwell [off-list ref]
@@ -804,6 +804,9 @@ KBUILD_CFLAGS += -Wdeclaration-after-statement# Variable Length Arrays (VLAs) should not be used anywhere in the kernelKBUILD_CFLAGS+=$(callcc-option,-Wvla)+# Check for implict fallthroughs+KBUILD_CFLAGS+=$(callcc-option,-Wimplicit-fallthrough)+# disable pointer signed / unsigned warnings in gcc 4.0KBUILD_CFLAGS+=-Wno-pointer-sign
Unfortunately, some of the kernel is built with -Werror, so I have had
to add the following patch as well just to build Linus' tree:
(I just marked them as "fall through", I am not sure if that is the
correct resolution.)
From: Stephen Rothwell <redacted>
Date: Mon, 26 Nov 2018 08:32:39 +1100
Subject: [PATCH] powerpc: tag implicit fall throughs
Signed-off-by: Stephen Rothwell <redacted>
---
arch/powerpc/kernel/nvram_64.c | 1 +
arch/powerpc/platforms/powermac/feature.c | 1 +
arch/powerpc/xmon/xmon.c | 1 +
3 files changed, 3 insertions(+)
@@ -809,6 +809,7 @@ static long dev_nvram_ioctl(struct file *file, unsigned int cmd,#ifdef CONFIG_PPC_PMACcaseOBSOLETE_PMAC_NVRAM_GET_OFFSET:printk(KERN_WARNING"nvram: Using obsolete PMAC_NVRAM_GET_OFFSET ioctl\n");+/* fall through */caseIOC_NVRAM_GET_OFFSET:{intpart,offset;
@@ -1471,6 +1471,7 @@ static long g5_i2s_enable(struct device_node *node, long param, long value)case2:if(macio->type==macio_shasta)break;+/* fall through */default:return-ENODEV;}
@@ -4033,6 +4033,7 @@ static int do_spu_cmd(void)subcmd=inchar();if(isxdigit(subcmd)||subcmd=='\n')termch=subcmd;+/* fall through */case'f':scanhex(&num);if(num>=XMON_NUM_SPUS||!spu_info[num].spu){--
From: Stephen Rothwell <hidden> Date: 2018-11-26 07:00:03
Hi Kees,
On Mon, 26 Nov 2018 17:49:26 +1100 Stephen Rothwell [off-list ref] wrote:
On Sun, 25 Nov 2018 21:46:20 -0800 Kees Cook [off-list ref] wrote:
quoted
Excellent! (Though, wait, does this mean everyone _else_ will see this
too? I'm worried that will be way too noisy...)
Ah, yes, you may be right. everyone will see them :-(
I may have to figure out another way to do this for tomorrow.
For today, I will just revert the commit that adds the flag at the
end or my merging run. People will only see the warnings if they are
bisecting.
--
Cheers,
Stephen Rothwell