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

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 22 05:24:43 PDT 2022


balazske added inline comments.


================
Comment at: clang/test/Analysis/wstring.c:385
+  wchar_t a[32];
+  // FIXME: This should work with 'w_str' instead of 'w_str1'
+  const wchar_t w_str1[] = L"Hello world";
----------------
martong wrote:
> balazske wrote:
> > The problem may be that the global constant is not encountered as statement when a function is analyzed.
> Do we have the same problem in the non-wide case?
Yes (the previous "cstring.c" file contained that test). The problem looks fixable if the string length is computed at first use, not at the variable declaration.


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