================
@@ -0,0 +1,23 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core  
-analyzer-checker=unix.cstring  -analyzer-checker=alpha.unix.cstring  
-analyzer-checker=debug.ExprInspection -verify %s 
+
+
+typedef __SIZE_TYPE__ size_t;
+
+void *memset_explicit(void *s, int c, size_t n);
+void clang_analyzer_eval(int);
+
+void test_memset_explicit_null(void) {
+  char *p = 0;
+  memset_explicit(p, 0, 10); // expected-warning{{Null pointer passed as 1st 
argument to memory set function}}
----------------
steakhal wrote:

Could you also test for demonstrating that the return value of it is correct 
per specification?
In other words, something like `memset_explicit(buf, 0, n) == buf`.

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

Reply via email to