Thread (7 messages) 7 messages, 3 authors, 2020-06-05

Re: [hnaz-linux-mm:master 169/698] include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'

From: Daniel Axtens <hidden>
Date: 2020-06-02 03:53:28
Also in: oe-kbuild-all

Daniel Axtens [off-list ref] writes:
Hi Andrew,
quoted
quoted
include/linux/string.h:297:30: warning: '__builtin_strncpy' specified bound 8 equals destination size [-Wstringop-truncation]
297 | #define __underlying_strncpy __builtin_strncpy
|                              ^
quoted
quoted
include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
307 |  return __underlying_strncpy(p, q, size);
|         ^~~~~~~~~~~~~~~~~~~~
Looks like another false positive.

Daniel, is there a practical way of suppressing these?
I think we probably want '-Wno-stringop-truncation'. That will stop
warnings where the bound equals the destination size (so there won't be
any null-truncation). But it won't stop the overflow warnings about
full-on overflows (-Wstringop-overflow).
Ah, so both stringop-truncate and stringop-overflow are disabled in
Makefile:
 - commit 5a76021c2eff ("gcc-10: disable 'stringop-overflow' warning for now")
 - commit 217c3e019675 ("disable stringop truncation warnings for now")

However, at W=1, stringop-truncate is re-enabled - last touched commit
64a91907c896 ("kbuild: refactor scripts/Makefile.extrawarn"). That would
explain why we see this on test builds with W=1 only.

I'll bump it to W=2.
I'll send a patch.

Regards,
Daniel
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help