[clang-tools-extra] [clang-tidy] Add WarnOnSizeOfPointer mode to bugprone-sizeof-expression (PR #94356)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 6 07:20:17 PDT 2024


=?utf-8?q?DonĂ¡t?= Nagy <donat.nagy at ericsson.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/94356 at github.com>


================
@@ -227,6 +227,12 @@ Changes in existing checks
   <clang-tidy/checks/bugprone/optional-value-conversion>` check by eliminating
   false positives resulting from use of optionals in unevaluated context.
 
+- Improved :doc:`bugprone-sizeof-expression
+  <clang-tidy/checks/bugprone/sizeof-expression>` check by eliminating some
+  false positives and adding a new (off-by-default) option
+  ``WarnOnSizeOfPointer`` that reports all ``sizeof(pointer)`` expressions
----------------
EugeneZelenko wrote:

```suggestion
  `WarnOnSizeOfPointer` that reports all ``sizeof(pointer)`` expressions
```

Single back-ticks for option names and values.

https://github.com/llvm/llvm-project/pull/94356


More information about the cfe-commits mailing list