| 3484 | |
| 3485 | |
| 3486 | void CheckOtherImpl::negativeBitwiseShiftError(const Token *tok, int op) |
| 3487 | { |
| 3488 | if (op == 1) |
| 3489 | // LHS - this is used by intention in various software, if it |
| 3490 | // is used often in a project and works as expected then this is |
| 3491 | // a portability issue |
| 3492 | reportError(tok, Severity::portability, "shiftNegativeLHS", "Shifting a negative value is technically undefined behaviour", CWE758, Certainty::normal); |
| 3493 | else // RHS |
| 3494 | reportError(tok, Severity::error, "shiftNegative", "Shifting by a negative value is undefined behaviour", CWE758, Certainty::normal); |
| 3495 | } |
| 3496 | |
| 3497 | //--------------------------------------------------------------------------- |
| 3498 | // Check for incompletely filled buffers. |
no test coverage detected