Skip to content

Commit da5966e

Browse files
committed
Revert "[clang][analyzer] Change default value of checker option in unix.StdCLibraryFunctions. (#80457)"
This reverts commit 7af4e8b.
1 parent db76af2 commit da5966e

File tree

3 files changed

+6
-19
lines changed

3 files changed

+6
-19
lines changed

clang/docs/analyzer/checkers.rst

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,23 +1320,10 @@ range of the argument.
13201320
13211321
**Parameters**
13221322
1323-
The ``ModelPOSIX`` option controls if functions from the POSIX standard are
1324-
recognized by the checker.
1325-
1326-
With ``ModelPOSIX=true``, many POSIX functions are modeled according to the
1327-
`POSIX standard`_. This includes ranges of parameters and possible return
1328-
values. Furthermore the behavior related to ``errno`` in the POSIX case is
1329-
often that ``errno`` is set only if a function call fails, and it becomes
1330-
undefined after a successful function call.
1331-
1332-
With ``ModelPOSIX=false``, this checker follows the C99 language standard and
1333-
only models the functions that are described there. It is possible that the
1334-
same functions are modeled differently in the two cases because differences in
1335-
the standards. The C standard specifies less aspects of the functions, for
1336-
example exact ``errno`` behavior is often unspecified (and not modeled by the
1337-
checker).
1338-
1339-
Default value of the option is ``true``.
1323+
The checker models functions (and emits diagnostics) from the C standard by
1324+
default. The ``ModelPOSIX`` option enables modeling (and emit diagnostics) of
1325+
additional functions that are defined in the POSIX standard. This option is
1326+
disabled by default.
13401327
13411328
.. _osx-checkers:
13421329

clang/include/clang/StaticAnalyzer/Checkers/Checkers.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ def StdCLibraryFunctionsChecker : Checker<"StdCLibraryFunctions">,
578578
"ModelPOSIX",
579579
"If set to true, the checker models additional functions "
580580
"from the POSIX standard.",
581-
"true",
581+
"false",
582582
InAlpha>
583583
]>,
584584
WeakDependencies<[CallAndMessageChecker, NonNullParamChecker]>,

clang/test/Analysis/analyzer-config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
// CHECK-NEXT: unix.DynamicMemoryModeling:Optimistic = false
130130
// CHECK-NEXT: unix.Errno:AllowErrnoReadOutsideConditionExpressions = true
131131
// CHECK-NEXT: unix.StdCLibraryFunctions:DisplayLoadedSummaries = false
132-
// CHECK-NEXT: unix.StdCLibraryFunctions:ModelPOSIX = true
132+
// CHECK-NEXT: unix.StdCLibraryFunctions:ModelPOSIX = false
133133
// CHECK-NEXT: unroll-loops = false
134134
// CHECK-NEXT: verbose-report-filename = false
135135
// CHECK-NEXT: widen-loops = false

0 commit comments

Comments
 (0)