* linux-next: disabling -Wstringop-truncation
@ 2018-08-30 22:07 Stephen Rothwell
2018-08-30 22:32 ` Andi Kleen
2018-08-31 1:17 ` Linus Torvalds
0 siblings, 2 replies; 5+ messages in thread
From: Stephen Rothwell @ 2018-08-30 22:07 UTC (permalink / raw)
To: Linus; +Cc: Linux-kernel Mailing List, Linux-Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 1107 bytes --]
Hi Linus,
I am now mainly using gcc v8.2 for my builds and -Wstringop-truncation
causes so many warnings that I am sure to miss others, so I have
applied the below to my fixes tree until the noise reduces.
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Fri, 31 Aug 2018 07:47:28 +1000
Subject: [PATCH] disable stringop truncation warnings for now
They are too noisy
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
Makefile | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Makefile b/Makefile
index 2b458801ba74..a34a9283ee90 100644
--- a/Makefile
+++ b/Makefile
@@ -807,6 +807,9 @@ KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
# disable pointer signed / unsigned warnings in gcc 4.0
KBUILD_CFLAGS += $(call cc-disable-warning, pointer-sign)
+# disable stringop warnings in gcc 8+
+KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation)
+
# disable invalid "can't wrap" optimizations for signed / pointers
KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
--
2.19.0.rc1
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: linux-next: disabling -Wstringop-truncation
2018-08-30 22:07 linux-next: disabling -Wstringop-truncation Stephen Rothwell
@ 2018-08-30 22:32 ` Andi Kleen
2018-08-30 22:45 ` Stephen Rothwell
2018-08-31 1:17 ` Linus Torvalds
1 sibling, 1 reply; 5+ messages in thread
From: Andi Kleen @ 2018-08-30 22:32 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Linus, Linux-kernel Mailing List, Linux-Next Mailing List
Stephen Rothwell <sfr@canb.auug.org.au> writes:
> Hi Linus,
>
> I am now mainly using gcc v8.2 for my builds and -Wstringop-truncation
> causes so many warnings that I am sure to miss others, so I have
> applied the below to my fixes tree until the noise reduces.
I have the same problem.
However It's not clear if they're all false positives (I suspect not)
It would be better to move the warning to W=2 or so, and also needs
someone actually looking at them.
-Andi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: linux-next: disabling -Wstringop-truncation
2018-08-30 22:32 ` Andi Kleen
@ 2018-08-30 22:45 ` Stephen Rothwell
0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2018-08-30 22:45 UTC (permalink / raw)
To: Andi Kleen; +Cc: Linus, Linux-kernel Mailing List, Linux-Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 770 bytes --]
Hi Andi,
On Thu, 30 Aug 2018 15:32:06 -0700 Andi Kleen <ak@linux.intel.com> wrote:
>
> Stephen Rothwell <sfr@canb.auug.org.au> writes:
>
> > I am now mainly using gcc v8.2 for my builds and -Wstringop-truncation
> > causes so many warnings that I am sure to miss others, so I have
> > applied the below to my fixes tree until the noise reduces.
>
> I have the same problem.
>
> However It's not clear if they're all false positives (I suspect not)
Right.
> It would be better to move the warning to W=2 or so, and also needs
> someone actually looking at them.
Sure, my patch was just a quick fix for linux-next to make it more
manageable. Also, I am not worse off than when I was using older
compilers.
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: linux-next: disabling -Wstringop-truncation
2018-08-30 22:07 linux-next: disabling -Wstringop-truncation Stephen Rothwell
2018-08-30 22:32 ` Andi Kleen
@ 2018-08-31 1:17 ` Linus Torvalds
2018-09-20 16:28 ` Miguel Ojeda
1 sibling, 1 reply; 5+ messages in thread
From: Linus Torvalds @ 2018-08-31 1:17 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: Linux Kernel Mailing List, linux-next
On Thu, Aug 30, 2018 at 3:07 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> I am now mainly using gcc v8.2 for my builds and -Wstringop-truncation
> causes so many warnings that I am sure to miss others, so I have
> applied the below to my fixes tree until the noise reduces.
Applied.
If people want the warning with W=xyz, then this is still the correct
patch, and we should add a line to re-enable it in
scripts/Makefile.extrawarn.
Linus
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: linux-next: disabling -Wstringop-truncation
2018-08-31 1:17 ` Linus Torvalds
@ 2018-09-20 16:28 ` Miguel Ojeda
0 siblings, 0 replies; 5+ messages in thread
From: Miguel Ojeda @ 2018-09-20 16:28 UTC (permalink / raw)
To: Stephen Rothwell, Andi Kleen
Cc: Linux Kernel Mailing List, linux-next, Linus Torvalds
Hi Stephen, Andi, (Linus),
On Fri, Aug 31, 2018 at 3:17 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Thu, Aug 30, 2018 at 3:07 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>>
>> I am now mainly using gcc v8.2 for my builds and -Wstringop-truncation
>> causes so many warnings that I am sure to miss others, so I have
>> applied the below to my fixes tree until the noise reduces.
>
> Applied.
>
> If people want the warning with W=xyz, then this is still the correct
> patch, and we should add a line to re-enable it in
> scripts/Makefile.extrawarn.
For reference, I am sending the v5 of the Compiler Attributes series
with the __nonstring patches appended on top, and I am adding the
warning back as well, on W=1.
I think W=1 is better: there are not that many warnings compared to
those in W=2. AFAIK, it is relatively easy to achieve a clean W=1 (and
most code should at least try be W=1 clean, no?). Also, note that now
people can use __nonstring to suppress that warning (if applicable);
and that using properly __nonstring can detect even more problems
(i.e. adding __nonstring may trigger additional warnings, e.g.
-Wstringop-overflow); so I think we should encourage the use of
__nonstring.
Cheers,
Miguel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-09-20 16:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-30 22:07 linux-next: disabling -Wstringop-truncation Stephen Rothwell
2018-08-30 22:32 ` Andi Kleen
2018-08-30 22:45 ` Stephen Rothwell
2018-08-31 1:17 ` Linus Torvalds
2018-09-20 16:28 ` Miguel Ojeda
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox