Skip to content

Commit c3fbfd7

Browse files
author
MalavikaSamak
committed
Update the documentation for the unsafe_buffer_usage attribute to capture the new
beahvior introduced by #125671
1 parent 506630d commit c3fbfd7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

clang/include/clang/Basic/AttrDocs.td

Lines changed: 5 additions & 3 deletions
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 the
7521+
``-Wunsafe-buffer-usage`` warnings inside the function to which it is attached, since
7522+
it is now classified as an unsafe function. The attribute must be placed judiciously
7523+
as there won't be any warning for unsafe operations within the function and this can
7524+
also cause it to mask new usafe 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)