User Activity

  • Posted a comment on discussion General Discussion on cppcheck

    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

View All

Personal Data

Username:
loucypher
Joined:
2002-01-14 12:55:39

Projects

  • No projects to display.

Personal Tools

MongoDB Logo MongoDB