Menu

integerOverflow is not reported for the op '+='

wy163
2026-01-17
2026-01-17
  • wy163

    wy163 - 2026-01-17

    Hi,

    void main() {
        int max_v = INT_MAX;
        int x = max_v + 1;
        max_v += 1;
    }
    

    There is an integerOverflow reported for "x = max_v + 1". But it is not reported for "max_v += 1".

     
  • CHR

    CHR - 2026-01-17

    Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/14404

     

Log in to post a comment.