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

Function isSafeCast

lib/checkleakautovar.cpp:1173–1177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1171}
1172
1173static bool isSafeCast(const ValueType* vt, const Settings& settings)
1174{
1175 const size_t sizeOf = vt->getSizeOf(settings, ValueType::Accuracy::ExactOrZero, ValueType::SizeOf::Pointee);
1176 return sizeOf == 0 || sizeOf >= settings.platform.sizeof_pointer;
1177}
1178
1179void CheckLeakAutoVarImpl::ret(const Token *tok, VarInfo &varInfo, const bool isEndOfScope)
1180{

Callers 1

retMethod · 0.85

Calls 1

getSizeOfMethod · 0.80

Tested by

no test coverage detected