| 237 | } |
| 238 | |
| 239 | void CheckStringImpl::strPlusCharError(const Token *tok) |
| 240 | { |
| 241 | std::string charType = "char"; |
| 242 | if (tok && tok->astOperand2() && tok->astOperand2()->variable()) |
| 243 | charType = tok->astOperand2()->variable()->typeStartToken()->str(); |
| 244 | else if (tok && tok->astOperand2() && tok->astOperand2()->tokType() == Token::eChar && tok->astOperand2()->isLong()) |
| 245 | charType = "wchar_t"; |
| 246 | reportError(tok, Severity::error, "strPlusChar", "Unusual pointer arithmetic. A value of type '" + charType +"' is added to a string literal.", CWE665, Certainty::normal); |
| 247 | } |
| 248 | |
| 249 | static bool isMacroUsage(const Token* tok) |
| 250 | { |
no test coverage detected