[libcxx-commits] [libcxx] [libc++] Add unsafe-buffer-usage attributes to span, vector, string and string_view (PR #119603)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Dec 16 13:27:49 PST 2024


pkasting wrote:

Why only when hardening is disabled?

For comparison, in Chromium's span, we flag things like the pointer + size constructor of span as unsafe, even though we effectively "harden" it with a runtime check; we want to discourage use of such APIs at all, and move them to patterns where problems are more detectable at compile time or cannot occur at all.

https://github.com/llvm/llvm-project/pull/119603


More information about the libcxx-commits mailing list