From: Miroslav Benes <mbenes@suse.cz>
To: "Martin Liška" <mliska@suse.cz>
Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, jpoimboe@redhat.com
Subject: Re: [PATCH] objtool: Fix -Wformat-truncation seen with GCC 12.
Date: Wed, 12 Jan 2022 10:41:29 +0100 (CET) [thread overview]
Message-ID: <alpine.LSU.2.21.2201121039160.27851@pobox.suse.cz> (raw)
In-Reply-To: <5168172b-d6f2-a13b-5d43-175cd864ebe9@suse.cz>
[-- Attachment #1: Type: text/plain, Size: 1058 bytes --]
Hi,
On Wed, 12 Jan 2022, Martin Liška wrote:
> The patch fixes the following warning that seems reasonable:
>
> check.c:2836:58: error: '%d' directive output may be truncated writing between
> 1 and 10 bytes into a region of size 9 [-Werror=format-truncation=]
> 2836 | snprintf(pvname, sizeof(pvname), "pv_ops[%d]", idx);
>
> Signed-off-by: Martin Liška <mliska@suse.cz>
> ---
> tools/objtool/check.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> index a9a1f7259d62..9555f7ad57cd 100644
> --- a/tools/objtool/check.c
> +++ b/tools/objtool/check.c
> @@ -2852,7 +2852,7 @@ static inline bool func_uaccess_safe(struct symbol
> *func)
>
> static inline const char *call_dest_name(struct instruction *insn)
> {
> - static char pvname[16];
> + static char pvname[20];
> struct reloc *rel;
> int idx;
a similar patch has already been posted (not merged yet though).
https://lore.kernel.org/all/20211223182707.42590-1-kilobyte@angband.pl/
Thanks
Miroslav
prev parent reply other threads:[~2022-01-12 9:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-12 9:29 Martin Liška
2022-01-12 9:38 ` David Laight
2022-01-12 9:41 ` Miroslav Benes [this message]
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=alpine.LSU.2.21.2201121039160.27851@pobox.suse.cz \
--to=mbenes@suse.cz \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mliska@suse.cz \
--cc=peterz@infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®