User Activity

  • Posted a comment on discussion General Discussion on cppcheck

    While the warning has some merit for the sample program (because the condition is indeed redundant as it can never be satisfied), it is confusing for similar code using post-incrementation: struct s foo = { 0 }; foo.array[foo.index++] = 1; if (foo.index == 1) { ... } In this case, neither the condition is redundant nor the array is accessed out of bounds.

  • Posted a comment on discussion General Discussion on cppcheck

    Hi there, Thank you again for your work on cppcheck! For the following C program: struct s { int array[1]; int index; }; int main(void) { struct s foo = { 0 }; foo.array[foo.index] = 1; if (foo.index == 1) { return foo.index; } return 0; } cppcheck 2.4.1 (with --enable=warning) reports: Checking test.c ... test.c:8:11: warning: Either the condition 'foo.index==1' is redundant or the array 'foo.array[1]' is accessed at index 1, which is out of bounds. [arrayIndexOutOfBoundsCond] foo.array[foo.index]...

  • Posted a comment on discussion General Discussion on cppcheck

    Hi there, Thank you for your work on cppcheck! For the following C program: int main(int argc, char *argv[]) { int quotient, remainder; remainder = argc % 2; argc /= 2; quotient = argc; if (quotient != 0) { return quotient; } return remainder; } cppcheck 2.3 (with --enable=warning) reports: Checking test.c ... test.c:4:19: warning: Either the condition 'quotient!=0' is redundant or there is division by zero at line 4. [zerodivcond] remainder = argc % 2; ^ test.c:8:15: note: Assuming that condition...

  • Posted a comment on discussion General Discussion on cppcheck

    This issue appears to have been fixed by commit 72fa5f2e2729bc8ccf79cfb24ab4ac5a35f9faad, i.e. in cppcheck 2.2.

  • Posted a comment on discussion General Discussion on cppcheck

    Hi there, Thank you for your work on cppcheck! For the following C code: struct foo { int x; }; int main(void) { struct foo bar; (&bar)->x = 1; if (bar.x == 0) { } return 0; } cppcheck 2.0 reports: Checking test.c ... test.c:8:10: error: Uninitialized variable: x [uninitvar] if (bar.x == 0) { } ^ Using an intermediate variable silences the warning: struct foo *baz = &bar; baz->x = 1; So does lack of indirection, of course: bar.x = 1; "git bisect" claims that commit 7368a54629a0174383cedfdb4ec5e4b73475cfa3...

  • Posted a comment on ticket #517 on Enigmail

    Thanks! In my patch I tried hard not to call istream.available() twice for each loop...

  • Posted a comment on ticket #517 on Enigmail

    Minor correction: in the first paragraph, I obviously meant after right-clicking...

  • Created ticket #517 on Enigmail

    Detached signatures for large attachments fail to verify

View All

Personal Data

Username:
mkepien
Joined:
2004-10-17 18:31:50

Projects

This is a list of open source software projects that Michał Kępień is associated with:

  • cs-stats   Last Updated:
  • www2cd   Last Updated:

Personal Tools

MongoDB Logo MongoDB