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 false uint8_t d0 = message->length > 0 ? data[0] : 0xff;
on latest main HEAD (d90ee9bfb9940fe84a826ad0267e5b1db55d23b8)
thanks, jacob
Thanks! I agree. the trac server is down so I can't create a ticket right now :-(
the trac server seems to be up now :)
thanks! I forgot this. I have now created this ticket: https://trac.cppcheck.net/ticket/10582
Log in to post a comment.
hi,
i believe this is a false positive:
gives:
on latest main HEAD (d90ee9bfb9940fe84a826ad0267e5b1db55d23b8)
thanks, jacob
Thanks! I agree. the trac server is down so I can't create a ticket right now :-(
the trac server seems to be up now :)
thanks! I forgot this. I have now created this ticket: https://trac.cppcheck.net/ticket/10582