[clang] [analyzer] Accept C library functions from the `std` namespace (PR #84469)

via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 8 04:47:15 PST 2024


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


================
@@ -41,12 +41,8 @@ class CallDescription {
     ///  - We also accept calls where the number of arguments or parameters is
     ///    greater than the specified value.
     /// For the exact heuristics, see CheckerContext::isCLibraryFunction().
-    /// Note that functions whose declaration context is not a TU (e.g.
-    /// methods, functions in namespaces) are not accepted as C library
-    /// functions.
-    /// FIXME: If I understand it correctly, this discards calls where C++ code
-    /// refers a C library function through the namespace `std::` via headers
-    /// like <cstdlib>.
+    /// (This mode only matches functions that are declared either directly
+    /// within a TU or in the namespace `std`.)
----------------
NagyDonat wrote:

I think saying "functions from the C standard library" (at the beginning of this comment block) is clear enough, mentioning `malloc` is redundant after it. Also, technically, we are not using this mode for `malloc` _yet_. 

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


More information about the cfe-commits mailing list