User Activity

  • Modified a comment on discussion Development on cppcheck

    with a simple c file: #include "x.h" cppcheck is incredibly slow when run if x.h is large. see attached files (a.h, b.h). runtime for me with respective file: a.h (32769 bytes): 0.209s b.h (147119 bytes): 34.299s cppcheck --force -v --enable=all --inline-suppr -I . x.c i ran this with latest head (87719121bdf2bba2bdc629cedab665c420b708c7).

  • Posted a comment on discussion Development on cppcheck

    with a simple c file: #include "x.h" cppcheck is incredibly slow when run if x.h is large. see attached files (a.h, b.h). runtime for me with respective file: a.h (32769 bytes): 0.209s b.h (147119 bytes): 34.299s cppcheck --force -v --enable=all --inline-suppr -I . x.c

  • Posted a comment on discussion General Discussion on cppcheck

    hey, this code: int fun() { static int k; k++; return k; } gives: tmp.c:2:16: style: Variable 'k' is not assigned a value. [unassignedVariable] static int k; ^ tmp.c:1:0: style: The function 'fun' is never used. [unusedFunction] ^ i don't think the unassignedVariable warning is correct. tested with latest main (07caf17eb3f2da73602f09c987139ef5a9c3f59f). thanks, jacob

  • Posted a comment on discussion General Discussion on cppcheck

    cppcheck d36aa590cdd499d2f41e42c79dec607a91c0edf5 given: static int func() { int rc; while (true) { rc = func(); break; } return rc; } yields: x.c:9:12: error: Uninitialized variable: rc [uninitvar] return rc; ^ x.c:4:12: note: Assuming condition is false while (true) { ^ x.c:9:12: note: Uninitialized variable: rc return rc;

  • Posted a comment on discussion General Discussion on cppcheck

    the trac server seems to be up now :)

  • Posted a comment on discussion General Discussion on cppcheck

    hi, i believe this is a false positive: static void fun(message_t *message) { if (message->length >= 1) { switch (data[0]) { } } uint8_t d0 = message->length > 0 ? data[0] : 0xff; } gives: test.c:6:34: style: Condition 'message->length>0' is always false [knownConditionTrueFalse] uint8_t d0 = message->length > 0 ? data[0] : 0xff; ^ test.c:2:25: note: Assuming that condition 'message->length>=1' is not redundant if (message->length >= 1) { ^ test.c:6:34: note: Condition 'message->length>0' is always...

  • Posted a comment on discussion General Discussion on cppcheck

    int get_delta() { clock_t now_ms = (clock() / (CLOCKS_PER_SEC / 1000)); static clock_t last_clock_ms = now_ms; clock_t delta = now_ms - last_clock_ms; last_clock_ms = now_ms; if (delta > 50) delta = 50; return delta; } gives fp.c:7:15: style: Condition 'delta>50' is always false [knownConditionTrueFalse] if (delta > 50) ^ fp.c:3:34: note: last_clock_ms is assigned 'now_ms' here. static clock_t last_clock_ms = now_ms; ^ fp.c:4:28: note: Assignment 'delta=now_ms-last_clock_ms', assigned value is 0...

  • Posted a comment on discussion Development on cppcheck

    right - thanks for your reply!

View All

Personal Data

Username:
jsiverskog
Joined:
2020-12-12 10:38:52

Projects

  • No projects to display.

Personal Tools

MongoDB Logo MongoDB