Given the following code, and a generated warning
static int64_t floor_divn(int64_t x_in, int64_t y_in) { int64_t x = x_in; int64_t y = y_in; int64_t quot = INT64_MAX; if (y != 0) { if ((x > 0) && (y < 0)) { x = -x; y = -y; } if ((x < 0) && (y > 0)) { x = x - y + 1; } quot = x / y; // warning: Either the condition 'y>0' is redundant or // there is division by zero at line ... [zerodivcond] } return quot; }
to me it looks like none of the two hypothesis for a warning is true
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/13292
Log in to post a comment.
Given the following code, and a generated warning
to me it looks like none of the two hypothesis for a warning is true
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/13292