diff options
author | Arnd Bergmann <arnd@arndb.de> | 2021-03-23 16:03:32 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-03-25 01:16:09 +0300 |
commit | 4adec7f81df8e4fbf55f9d5ca98afa39f15b050f (patch) | |
tree | 63d515f89bec673f2ed9917820e966f32b05da45 /include | |
parent | b7fbc88692e60a4955ac54af0bcf7f2162761339 (diff) | |
download | linux-4adec7f81df8e4fbf55f9d5ca98afa39f15b050f.tar.xz |
rhashtable: avoid -Wrestrict warning on overlapping sprintf output
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] = "";
| ^~~~
Rework this function to remember the last offset instead to
avoid the warning.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions