Re: git: faae895fec65 - main - fusefs tests: Use memcpy to work around a -Wstrlcpy-strlcast-size warning
Date: Fri, 11 Apr 2025 20:04:39 UTC
On 4/11/25 15:16, John Baldwin wrote: > The branch main has been updated by jhb: > > URL: https://cgit.FreeBSD.org/src/commit/?id=faae895fec6571242ae05b11bc7eba0dff83fa49 > > commit faae895fec6571242ae05b11bc7eba0dff83fa49 > Author: John Baldwin <jhb@FreeBSD.org> > AuthorDate: 2025-04-11 19:12:58 +0000 > Commit: John Baldwin <jhb@FreeBSD.org> > CommitDate: 2025-04-11 19:12:58 +0000 > > fusefs tests: Use memcpy to work around a -Wstrlcpy-strlcast-size warning > > tests/sys/fs/fusefs/xattr.cc:572:50: error: size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination [-Werror,-Wstrlcpy-strlcat-size] > 572 | strlcpy((char*)out.body.bytes, attrs1, sizeof(attrs1)); > | ~~~~~~~^~~~~~~ > > The warning is correct in that the size is the size of the source, but > that is intended in this case. Use memcpy() instead of strlcpy() to > match the same code in the size_only_race_smaller test above. > > Differential Revision: https://reviews.freebsd.org/D49786 Apologies for the breakage. I have no idea why I did not see this failure earlier. I had done multiple buildworld + tinderboxes and even requested an exp-run from ports and none of these had tripped over this fuse test, and the fuse test code hasn't changed in several years. -- John Baldwin