lkml.org 
[lkml]   [2021]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] rhashtable: avoid -Wrestrict warning on overlapping sprintf output
From
Date
Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Tue, 23 Mar 2021 14:03:32 +0100 you wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> sprintf() is declared with a restrict keyword to not allow input and
> output to point to the same buffer:
>
> lib/test_rhashtable.c: In function 'print_ht':
> lib/test_rhashtable.c:504:4: error: 'sprintf' argument 3 overlaps destination object 'buff' [-Werror=restrict]
> 504 | sprintf(buff, "%s\nbucket[%d] -> ", buff, i);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> lib/test_rhashtable.c:489:7: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
> 489 | char buff[512] = "";
> | ^~~~
>
> [...]

Here is the summary with links:
- rhashtable: avoid -Wrestrict warning on overlapping sprintf output
https://git.kernel.org/netdev/net-next/c/4adec7f81df8

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html


\
 
 \ /
  Last update: 2021-03-24 23:22    [W:0.029 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site