[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZShO1HOVI8WkxziA@slm.duckdns.org>
Date: Thu, 12 Oct 2023 09:53:56 -1000
From: Tejun Heo <tj@...nel.org>
To: Lucy Mielke <lucymielke@...oud.com>
Cc: jiangshanlai@...il.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] workqueue: fix -Wformat-truncation in create_worker
On Mon, Oct 09, 2023 at 07:09:46PM +0200, Lucy Mielke wrote:
> Compiling with W=1 emitted the following warning
> (Compiler: gcc (x86-64, ver. 13.2.1, .config: result of make allyesconfig,
> "Treat warnings as errors" turned off):
>
> kernel/workqueue.c:2188:54: warning: ‘%d’ directive output may be
> truncated writing between 1 and 10 bytes into a region of size
> between 5 and 14 [-Wformat-truncation=]
> kernel/workqueue.c:2188:50: note: directive argument in the range
> [0, 2147483647]
> kernel/workqueue.c:2188:17: note: ‘snprintf’ output between 4 and 23 bytes
> into a destination of size 16
>
> setting "id_buf" to size 23 will silence the warning, since GCC
> determines snprintf's output to be max. 23 bytes in line 2188.
>
> Please let me know if there are any mistakes in my patch!
>
> Signed-off-by: Lucy Mielke <lucymielke@...oud.com>
Applied to wq/for-6.6-fixes.
Thanks.
--
tejun
Powered by blists - more mailing lists