================ @@ -515,8 +515,18 @@ Warning flags + ``-Wthread-safety-analysis``: The core analysis. + ``-Wthread-safety-precise``: Requires that mutex expressions match precisely. This warning can be disabled for code which has a lot of aliases. - + ``-Wthread-safety-reference``: Checks when guarded members are passed by reference. - + + ``-Wthread-safety-reference``: Checks when guarded variables are passed by reference. + +* ``-Wthread-safety-addressof``: Warn when the address of guarded variables is + taken (``&var``). Since taking the address of a variable does *not + necessarily imply a read or write*, the warning is off by default to avoid + false positives. In codebases that prefer passing pointers rather than + references (for C++ codebases), or passing pointers is ubiquitous (for C + codebases), enabling this warning will result in fewer false negatives; for + example, where the manipulation of common data structures is done via + functions that take pointers to instances of the data structure. Note, + however, that the analysis does not track pointers, and false positives *and* + negatives are still possible. ---------------- melver wrote:
Made it depend on Wthread-safety-beta. https://github.com/llvm/llvm-project/pull/123063 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits