[clang] [clang][analyzer] Add documentation for unix modeling checker options (NFC) (PR #207225)
Balázs Kéri via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 2 09:31:11 PDT 2026
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/207225
None
>From dee75c538ce0ebbcb577be47a8e22fafa1802b28 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= <balazs.keri at ericsson.com>
Date: Thu, 2 Jul 2026 18:14:18 +0200
Subject: [PATCH] [clang][analyzer] Add documentation for unix modeling checker
options (NFC)
---
clang/docs/analyzer/checkers.rst | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/clang/docs/analyzer/checkers.rst b/clang/docs/analyzer/checkers.rst
index f4cda9ec4b0c1..062c8b0469223 100644
--- a/clang/docs/analyzer/checkers.rst
+++ b/clang/docs/analyzer/checkers.rst
@@ -2075,6 +2075,32 @@ unix
^^^^
POSIX/Unix checkers.
+.. _unix-generic-options:
+
+unix generic options
+""""""""""""""""""""
+These are common options that affect multiple checkers in the ``unix`` group.
+
+* ``unix.DynamicMemoryModeling:Optimistic``
+
+ If set to ``true``, the static analyzer assumes that all memory allocations
+ and deallocations (like ``malloc`` or ``free``) are marked with
+ ``ownership_holds``, ``ownership_takes`` and ``ownership_returns``
+ attributes. For more information see
+ `Attributes in Clang <../AttributeReference.html#ownership-holds-ownership-returns-ownership-takes-clang-static-analyzer>`_.
+ Default value is ``false``.
+
+* ``unix.DynamicMemoryModeling:ModelAllocationFailure``
+
+ Setting this option to ``true`` enforces that the return value of memory
+ allocation functions is tested for null by the programmer (if applicable).
+ By default the analyzer does not know if a returned pointer is null or
+ non-null after an allocation and access of this pointer is not reported as
+ null pointer access. If the option is set to ``true`` the analyzer adds a
+ specific execution branch where the return value is known to be null and a
+ possible null pointer access can be found by other checkers. Default value of
+ the option is ``false``.
+
.. _unix-API:
unix.API (C)
More information about the cfe-commits
mailing list