All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Axtens <dja@axtens.net>
To: Andrew Morton <akpm@linux-foundation.org>,
	kbuild test robot <lkp@intel.com>
Cc: kbuild-all@lists.01.org, Johannes Weiner <hannes@cmpxchg.org>,
	Dmitry Vyukov <dvyukov@google.com>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [hnaz-linux-mm:master 169/698] include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
Date: Tue, 02 Jun 2020 13:53:22 +1000	[thread overview]
Message-ID: <87tuzuyvgt.fsf@dja-thinkpad.axtens.net> (raw)
In-Reply-To: <87wo4qywp4.fsf@dja-thinkpad.axtens.net>

Daniel Axtens <dja@axtens.net> writes:

> Hi Andrew,
>
>>> include/linux/string.h:297:30: warning: '__builtin_strncpy' specified bound 8 equals destination size [-Wstringop-truncation]
>>> 297 | #define __underlying_strncpy __builtin_strncpy
>>> |                              ^
>>> >> 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


WARNING: multiple messages have this Message-ID (diff)
From: Daniel Axtens <dja@axtens.net>
To: kbuild-all@lists.01.org
Subject: Re: [hnaz-linux-mm:master 169/698] include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
Date: Tue, 02 Jun 2020 13:53:22 +1000	[thread overview]
Message-ID: <87tuzuyvgt.fsf@dja-thinkpad.axtens.net> (raw)
In-Reply-To: <87wo4qywp4.fsf@dja-thinkpad.axtens.net>

[-- Attachment #1: Type: text/plain, Size: 1343 bytes --]

Daniel Axtens <dja@axtens.net> writes:

> Hi Andrew,
>
>>> include/linux/string.h:297:30: warning: '__builtin_strncpy' specified bound 8 equals destination size [-Wstringop-truncation]
>>> 297 | #define __underlying_strncpy __builtin_strncpy
>>> |                              ^
>>> >> 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

  reply	other threads:[~2020-06-02  3:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-30 10:07 [hnaz-linux-mm:master 169/698] include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy' kbuild test robot
2020-05-30 10:07 ` kbuild test robot
2020-06-02  1:04 ` Andrew Morton
2020-06-02  1:04   ` Andrew Morton
2020-06-02  3:26   ` Daniel Axtens
2020-06-02  3:26     ` Daniel Axtens
2020-06-02  3:53     ` Daniel Axtens [this message]
2020-06-02  3:53       ` Daniel Axtens
2020-06-02  5:55       ` Daniel Axtens
2020-06-02  5:55         ` Daniel Axtens
2020-06-02 19:16         ` Andrew Morton
2020-06-02 19:16           ` Andrew Morton
2020-06-05 10:35           ` Daniel Axtens
2020-06-05 10:35             ` Daniel Axtens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tuzuyvgt.fsf@dja-thinkpad.axtens.net \
    --to=dja@axtens.net \
    --cc=akpm@linux-foundation.org \
    --cc=dvyukov@google.com \
    --cc=hannes@cmpxchg.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.