Hi,
Here's a sample code to reproduce the issue; this is especially annoying because the convention for C macros are to always wrap the argument in parenthesis.
#include <stddef.h> struct Str { char *str; size_t len; }; extern int main(void) { struct Str tmp; char *s; tmp.str = NULL; s = (tmp).str; return 0; }
This produces the following error:
Checking test2.c ... test2.c:11:7: error: Uninitialized struct member: tmp.len [uninitStructMember] s = (tmp).str; ^
Tested on cppcheck v2.6.3
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/11002
Log in to post a comment.
Hi,
Here's a sample code to reproduce the issue; this is especially annoying because the convention for C macros are to always wrap the argument in parenthesis.
This produces the following error:
Tested on cppcheck v2.6.3
Last edit: NRK 2022-04-24
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/11002