MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / floatToIntegerOverflowError

Method floatToIntegerOverflowError

lib/checktype.cpp:524–532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

522}
523
524void CheckTypeImpl::floatToIntegerOverflowError(const Token *tok, const ValueFlow::Value &value)
525{
526 std::ostringstream errmsg;
527 errmsg << "Undefined behaviour: float (" << value.floatValue << ") to integer conversion overflow.";
528 reportError(getErrorPath(tok, &value, "float to integer conversion"),
529 value.errorSeverity() ? Severity::error : Severity::warning,
530 "floatConversionOverflow",
531 errmsg.str(), CWE190, value.isInconclusive() ? Certainty::inconclusive : Certainty::normal);
532}
533
534void CheckType::runChecks(const Tokenizer &tokenizer, ErrorLogger& errorLogger)
535{

Callers 1

getErrorMessagesMethod · 0.80

Calls 3

reportErrorFunction · 0.70
strMethod · 0.45
isInconclusiveMethod · 0.45

Tested by

no test coverage detected