[clang] da5966e - Revert "[clang][analyzer] Change default value of checker option in unix.StdCLibraryFunctions. (#80457)"

Balázs Kéri via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 4 00:53:54 PST 2024


Author: Balázs Kéri
Date: 2024-03-04T09:50:36+01:00
New Revision: da5966e0c102f03ab853b906377814675db3623c

URL: https://github.com/llvm/llvm-project/commit/da5966e0c102f03ab853b906377814675db3623c
DIFF: https://github.com/llvm/llvm-project/commit/da5966e0c102f03ab853b906377814675db3623c.diff

LOG: Revert "[clang][analyzer] Change default value of checker option in unix.StdCLibraryFunctions. (#80457)"

This reverts commit 7af4e8bcc354d2bd7e46ecf547172b1f19ddde3e.

Added: 
    

Modified: 
    clang/docs/analyzer/checkers.rst
    clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
    clang/test/Analysis/analyzer-config.c

Removed: 
    


################################################################################
diff  --git a/clang/docs/analyzer/checkers.rst b/clang/docs/analyzer/checkers.rst
index fe211514914272..899622ae283b17 100644
--- a/clang/docs/analyzer/checkers.rst
+++ b/clang/docs/analyzer/checkers.rst
@@ -1320,23 +1320,10 @@ range of the argument.
 
 **Parameters**
 
-The ``ModelPOSIX`` option controls if functions from the POSIX standard are
-recognized by the checker.
-
-With ``ModelPOSIX=true``, many POSIX functions are modeled according to the
-`POSIX standard`_. This includes ranges of parameters and possible return
-values. Furthermore the behavior related to ``errno`` in the POSIX case is
-often that ``errno`` is set only if a function call fails, and it becomes
-undefined after a successful function call.
-
-With ``ModelPOSIX=false``, this checker follows the C99 language standard and
-only models the functions that are described there. It is possible that the
-same functions are modeled 
diff erently in the two cases because 
diff erences in
-the standards. The C standard specifies less aspects of the functions, for
-example exact ``errno`` behavior is often unspecified (and not modeled by the
-checker).
-
-Default value of the option is ``true``.
+The checker models functions (and emits diagnostics) from the C standard by
+default. The ``ModelPOSIX`` option enables modeling (and emit diagnostics) of
+additional functions that are defined in the POSIX standard. This option is
+disabled by default.
 
 .. _osx-checkers:
 

diff  --git a/clang/include/clang/StaticAnalyzer/Checkers/Checkers.td b/clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
index a224b81c33a624..e7774e5a9392d2 100644
--- a/clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
+++ b/clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
@@ -578,7 +578,7 @@ def StdCLibraryFunctionsChecker : Checker<"StdCLibraryFunctions">,
                   "ModelPOSIX",
                   "If set to true, the checker models additional functions "
                   "from the POSIX standard.",
-                  "true",
+                  "false",
                   InAlpha>
   ]>,
   WeakDependencies<[CallAndMessageChecker, NonNullParamChecker]>,

diff  --git a/clang/test/Analysis/analyzer-config.c b/clang/test/Analysis/analyzer-config.c
index 2167a2b32f5962..373017f4b18bfc 100644
--- a/clang/test/Analysis/analyzer-config.c
+++ b/clang/test/Analysis/analyzer-config.c
@@ -129,7 +129,7 @@
 // CHECK-NEXT: unix.DynamicMemoryModeling:Optimistic = false
 // CHECK-NEXT: unix.Errno:AllowErrnoReadOutsideConditionExpressions = true
 // CHECK-NEXT: unix.StdCLibraryFunctions:DisplayLoadedSummaries = false
-// CHECK-NEXT: unix.StdCLibraryFunctions:ModelPOSIX = true
+// CHECK-NEXT: unix.StdCLibraryFunctions:ModelPOSIX = false
 // CHECK-NEXT: unroll-loops = false
 // CHECK-NEXT: verbose-report-filename = false
 // CHECK-NEXT: widen-loops = false


        


More information about the cfe-commits mailing list