[PATCH] D130091: [clang][analyzer] Added partial wide character support to CStringChecker

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 20 02:43:15 PDT 2022


martong added a comment.

Nice improvement and the tests are meaningful!

> clang/test/Analysis/cstring.c

Hadn't we have already a test file for this checker? What about `string.c` and `bstring.c`? You might have added redundant test cases in the new test file.



================
Comment at: clang/test/Analysis/cstring.c:36
+  char buffer[32];
+  // FIXME: This should work with 'str' instead of 'str1'
+  const char str1[] = "Hello world";
----------------
Could you please elaborate why this does not work with `str`?


================
Comment at: clang/test/Analysis/cstring.c:68-69
+  char buffer[32];
+  const char str1[] = "Hello\0world";
+  clang_analyzer_eval(strlen(str1) == 11); // expected-warning {{TRUE}}
+}
----------------
I think, this would deserve a FIXME comment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130091



More information about the cfe-commits mailing list