Support for functions wmemcpy, wcslen, wcsnlen is added to the checker.
Documentation and tests are updated and extended with the new functions.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
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.
clang/test/Analysis/cstring.c | ||
---|---|---|
36 ↗ | (On Diff #445823) | Could you please elaborate why this does not work with str? |
68–69 ↗ | (On Diff #445823) | I think, this would deserve a FIXME comment. |
I did not found the existing tests in other files, now all tests for the "non-wide" functions are copied for the "wide" functions. I do not like fully this solution but a single test file with macros for wide and non-wide case is probably not better.
clang/test/Analysis/wstring.c | ||
---|---|---|
385 | The problem may be that the global constant is not encountered as statement when a function is analyzed. |
Okay, thanks for the update. LGTM!
clang/test/Analysis/wstring.c | ||
---|---|---|
385 | Do we have the same problem in the non-wide case? |
clang/test/Analysis/wstring.c | ||
---|---|---|
385 | 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. |
The problem may be that the global constant is not encountered as statement when a function is analyzed.