Skip to content

Commit 9afacb1

Browse files
committed
Update documentation wording on false positives and negatives
Update documentation wording to be clearer about false positives and negatives of Wthread-safety-addressof.
1 parent 6727047 commit 9afacb1

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

clang/docs/ThreadSafetyAnalysis.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -518,13 +518,15 @@ Warning flags
518518
+ ``-Wthread-safety-reference``: Checks when guarded variables are passed by reference.
519519

520520
* ``-Wthread-safety-addressof``: Warn when the address of guarded variables is
521-
obtained (``&var``). Since obtaining the address of a variable doesn't
522-
necessarily imply a read or write, the warning is off by default. In
523-
codebases that prefer passing pointers rather than references (for C++
524-
codebases), or passing pointers is ubiquitous (for C codebases), enabling
525-
this warning will result in fewer false negatives; for example, where the
526-
manipulation of common data structures is done via functions that take
527-
pointers to instances of the data structure.
521+
obtained (``&var``). Since obtaining the address of a variable does *not
522+
necessarily imply a read or write*, the warning is off by default to avoid
523+
false positives. In codebases that prefer passing pointers rather than
524+
references (for C++ codebases), or passing pointers is ubiquitous (for C
525+
codebases), enabling this warning will result in fewer false negatives; for
526+
example, where the manipulation of common data structures is done via
527+
functions that take pointers to instances of the data structure. Note,
528+
however, that the analysis does not track pointers, and false positives *and*
529+
negatives are still possible.
528530

529531
:ref:`negative` are an experimental feature, which are enabled with:
530532

0 commit comments

Comments
 (0)