Author: Balázs Kéri Date: 2026-07-06T09:46:49+02:00 New Revision: 46aa983d0990692e9aab6917435faab8a6395aa0
URL: https://github.com/llvm/llvm-project/commit/46aa983d0990692e9aab6917435faab8a6395aa0 DIFF: https://github.com/llvm/llvm-project/commit/46aa983d0990692e9aab6917435faab8a6395aa0.diff LOG: [clang][analyzer] Add documentation for unix modeling checker options (NFC) (#207225) Added: Modified: clang/docs/analyzer/checkers.rst Removed: ################################################################################ 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) _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
