Skip to content

Commit 63d9cc8

Browse files
committed
fixup: update the documentation
Mention the change in the release notes and extend the attribute descriptions.
1 parent 63c5c58 commit 63d9cc8

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,10 @@ Attribute Changes in Clang
327327
- New format attributes ``gnu_printf``, ``gnu_scanf``, ``gnu_strftime`` and ``gnu_strfmon`` are added
328328
as aliases for ``printf``, ``scanf``, ``strftime`` and ``strfmon``. (#GH16219)
329329

330+
- The malloc attribute can now be applied to functions returning span-like structures (structs
331+
containing a pointer field and a size integer field). Currently, this is primarily used for
332+
Allocation Token instrumentation.
333+
330334
Improvements to Clang's diagnostics
331335
-----------------------------------
332336
- Diagnostics messages now refer to ``structured binding`` instead of ``decomposition``,

clang/include/clang/Basic/AttrDocs.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5244,6 +5244,11 @@ deallocation function. When this form is used, it enables the compiler to
52445244
diagnose when the incorrect deallocation function is used with this variable.
52455245
However the associated warning, spelled `-Wmismatched-dealloc` in GCC, is not
52465246
yet implemented in clang.
5247+
5248+
It's also possible to place the ``malloc`` attribute on the functions returning
5249+
span-like structures, that is, the structs having a pointer as the first field
5250+
and an integer with the size of the actually allocated memory as the second field.
5251+
Note that extended semantics is clang-specific and not currently supported in GCC.
52475252
}];
52485253
}
52495254

0 commit comments

Comments
 (0)