[clang] [NFC][analyzer] Document optin.portability.UnixAPI (PR #150005)
DonĂ¡t Nagy via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 24 05:52:35 PDT 2025
================
@@ -1103,7 +1103,16 @@ To override this threshold to e.g. 4 bytes, use the
optin.portability.UnixAPI
"""""""""""""""""""""""""
-Finds implementation-defined behavior in UNIX/Posix functions.
+Reports situations where 0 is passed as the "size" argument of various
+allocation functions ( ``calloc``, ``malloc``, ``realloc``, ``reallocf``,
+``alloca``, ``__builtin_alloca``, ``__builtin_alloca_with_align``, ``valloc``).
+
+Note that similar functionality is also supported by :ref:`unix-Malloc` which
+reports code that *uses* memory allocated with size zero.
+
+(The name of this checker is motivated by the fact that it was originally
+introduced with the vague goal that it "Finds implementation-defined behavior
+in UNIX/Posix functions.")
----------------
NagyDonat wrote:
I also thought about adding an example, but I feel that this particular checker is so simple that an example would just increase the bulk of our documentation without conveying actually useful information.
https://github.com/llvm/llvm-project/pull/150005
More information about the cfe-commits
mailing list