Skip to content

Commit 9102ccd

Browse files
malavikasamakMalavikaSamak
and
MalavikaSamak
authored
[CXX Safe Buffer] Update the documentation for unsafe_buffer_usage attribute (llvm#135087)
Update the documentation for the unsafe_buffer_usage attribute to capture the new behavior introduced by llvm#125671 Co-authored-by: MalavikaSamak <[email protected]>
1 parent 2927050 commit 9102ccd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

clang/include/clang/Basic/AttrDocs.td

+5-3
Original file line numberDiff line numberDiff line change
@@ -7517,9 +7517,11 @@ the field it is attached to, and it may also lead to emission of automatic fix-i
75177517
hints which would help the user replace the use of unsafe functions(/fields) with safe
75187518
alternatives, though the attribute can be used even when the fix can't be automated.
75197519

7520-
* Attribute attached to functions: The attribute does not suppress
7521-
``-Wunsafe-buffer-usage`` inside the function to which it is attached.
7522-
These warnings still need to be addressed.
7520+
* Attribute attached to functions: The attribute suppresses all
7521+
``-Wunsafe-buffer-usage`` warnings within the function it is attached to, as the
7522+
function is now classified as unsafe. The attribute should be used carefully, as it
7523+
will silence all unsafe operation warnings inside the function; including any new
7524+
unsafe operations introduced in the future.
75237525

75247526
The attribute is warranted even if the only way a function can overflow
75257527
the buffer is by violating the function's preconditions. For example, it

0 commit comments

Comments
 (0)