Hello ,
I implemented another checker for clang static checker.
It checks that some code uses strlen(or wcslen) to calculate the length of an std::string( or std::wstring)
.
example:
#include <string>
#include <string.h>
void test() {
std::string s;
if (strlen(s.c_str()) != 0) {}; // warn
}
Currently, I want to study clang static analyzer through developing some checkers.But I do not know whether my patches will be accepted by the clang community.
StrLengthCalculationChecker.cpp (5.47 KB)
str_length_calculation_test.cpp (599 Bytes)