| 580 | |
| 581 | |
| 582 | void CheckOtherImpl::invalidPointerCastError(const Token* tok, const std::string& from, const std::string& to, bool inconclusive, bool toIsInt) |
| 583 | { |
| 584 | if (toIsInt) { // If we cast something to int*, this can be useful to play with its binary data representation |
| 585 | reportError(tok, Severity::portability, "invalidPointerCast", "Casting from " + from + " to " + to + " is not portable due to different binary data representations on different platforms.", CWE704, inconclusive ? Certainty::inconclusive : Certainty::normal); |
| 586 | } else |
| 587 | reportError(tok, Severity::portability, "invalidPointerCast", "Casting between " + from + " and " + to + " which have an incompatible binary data representation.", CWE704, Certainty::normal); |
| 588 | } |
| 589 | |
| 590 | |
| 591 | //--------------------------------------------------------------------------- |
no test coverage detected