https://github.com/anondeveg created 
https://github.com/llvm/llvm-project/pull/219699

fixed a typo and gave proper bug types descriptions preserving the old 
categories.  

>From f22fc8f9ee6373f8ee7e7de2ee64ea651e2d7312 Mon Sep 17 00:00:00 2001
From: Anondev <[email protected]>
Date: Sat, 29 Aug 2026 19:35:55 +0300
Subject: [PATCH] [analyzer] Give CStringChecker bug types proper descriptions

---
 .../lib/StaticAnalyzer/Checkers/CStringChecker.cpp | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp 
b/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
index 9fd8d4880c59f..63c58cc633e5d 100644
--- a/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
@@ -31,6 +31,7 @@
 #include "llvm/ADT/STLForwardCompat.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Support/raw_ostream.h"
+#include <clang/StaticAnalyzer/Core/BugReporter/CommonBugCategories.h>
 #include <functional>
 #include <optional>
 
@@ -86,17 +87,12 @@ class CStringChecker
   mutable StringRef CurrentFunctionDescription;
 
 public:
-  // FIXME: The bug types emitted by this checker family have confused garbage
-  // in their Description and Category fields (e.g. `categories::UnixAPI` is
-  // passed as the description in several cases and `uninitialized` is mistyped
-  // as `unitialized`). This should be cleaned up.
-  CheckerFrontendWithBugType NullArg{categories::UnixAPI};
+  CheckerFrontendWithBugType NullArg{"Null pointer argument"};
   CheckerFrontendWithBugType OutOfBounds{"Out-of-bound array access"};
-  CheckerFrontendWithBugType BufferOverlap{categories::UnixAPI,
-                                           "Improper arguments"};
-  CheckerFrontendWithBugType NotNullTerm{categories::UnixAPI};
+  CheckerFrontendWithBugType BufferOverlap{"Overlapping buffers","Improper 
arguments"};
+  CheckerFrontendWithBugType NotNullTerm{"Not null-terminated string"};
   CheckerFrontendWithBugType UninitializedRead{
-      "Accessing unitialized/garbage values"};
+      "Accessing uninitialized/garbage values"};
 
   StringRef getDebugTag() const override { return "MallocChecker"; }
 

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to