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
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/11310
Log in to post a comment.
hey,
this code:
gives:
i don't think the unassignedVariable warning is correct.
tested with latest main (07caf17eb3f2da73602f09c987139ef5a9c3f59f).
thanks, jacob
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/11310