Date: Thu, 08 Jan 2026 17:15:28 +0000 From: Ed Maste <emaste@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Alex Richardson <arichardson@FreeBSD.org> Subject: git: 1410d22cac55 - stable/14 - libc++: silence -Wnontrivial-memaccess warning with newer clang Message-ID: <695fe630.31700.4fc829c3@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1410d22cac55c325dc437fb4575465001e65fe97 commit 1410d22cac55c325dc437fb4575465001e65fe97 Author: Alex Richardson <arichardson@FreeBSD.org> AuthorDate: 2025-09-15 22:14:18 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2026-01-08 17:14:06 +0000 libc++: silence -Wnontrivial-memaccess warning with newer clang Apply part of LLVM commit 71315698c91d0cda054b903da0594ca6f072c350 to silence the -Wnontrivial-memaccess warning that is triggered any time this function is instantiated by user code. This fixes another buildworld failure with Clang HEAD. Original commit message: [clang] Warn about memset/memcpy to NonTriviallyCopyable types (#111434) This implements a warning that's similar to what GCC does in that context: both memcpy and memset require their first and second operand to be trivially copyable, let's warn if that's not the case. Reviewed by: emaste, dim MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52534 (cherry picked from commit 34a006eaa39ceb6b0a96fa386c9b9b8a44681979) (cherry picked from commit ca149d75e9bd6455abc3c74e7db160464cfabbdb) --- .../llvm-project/libcxx/include/__memory/uninitialized_algorithms.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/llvm-project/libcxx/include/__memory/uninitialized_algorithms.h b/contrib/llvm-project/libcxx/include/__memory/uninitialized_algorithms.h index 7475ef5cf85d..79cab80dcf73 100644 --- a/contrib/llvm-project/libcxx/include/__memory/uninitialized_algorithms.h +++ b/contrib/llvm-project/libcxx/include/__memory/uninitialized_algorithms.h @@ -642,7 +642,8 @@ __uninitialized_allocator_relocate(_Alloc& __alloc, _Tp* __first, _Tp* __last, _ __guard.__complete(); std::__allocator_destroy(__alloc, __first, __last); } else { - __builtin_memcpy(const_cast<__remove_const_t<_Tp>*>(__result), __first, sizeof(_Tp) * (__last - __first)); + // Casting to void* to suppress clang complaining that this is technically UB. + __builtin_memcpy(static_cast<void*>(const_cast<__remove_const_t<_Tp>*>(__result)), __first, sizeof(_Tp) * (__last - __first)); } }home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?695fe630.31700.4fc829c3>
