[PATCH] D98741: [analyzer] Introduce common bug category "Unused code".

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 16 16:04:24 PDT 2021


NoQ added inline comments.


================
Comment at: clang/test/Analysis/Inputs/expected-plists/edges-new.mm.plist:11413
-   <key>category</key><string>Dead store</string>
+   <key>category</key><string>Unused code</string>
    <key>type</key><string>Dead initialization</string>
    <key>check_name</key><string>deadcode.DeadStores</string>
----------------
Charusso wrote:
> "Initialization was never used"? (Swift style: https://swift.godbolt.org/z/c17EMb)
That's a scan-build bugtype so it follows a different tradition. The actual warning is a few lines above and it says "Value stored to 'foo' during its initialization is never read".

Additionally, unlike clang or swift (which [[ https://github.com/apple/swift/blob/main/docs/Diagnostics.md | inherits the tradition from clang ]]), static analyzer warnings are traditionally expected to be complete sentences. So we typically won't be able to synchronize wording.

But in this case it might be possible given that the warnings already have a similar structure. I'll think about it ^.^


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98741/new/

https://reviews.llvm.org/D98741



More information about the cfe-commits mailing list