cppcheck --enable=all x.c
Checking x.c ...
x.c:7:11: style: The scope of the variable 'i' can be reduced. [variableScope]
myint i;
^
x.c:8:9: style: The scope of the variable 'n' can be reduced. [variableScope]
int n;
^
I would expect the same message for variables 'en' and 'e' as well.
Does anyone else consider this a bug?
Regards,
Jens
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hello, world\n
Using 2.5 (going at least back to 1.85), I observed this false-negative:
cppcheck --enable=all x.c
Checking x.c ...
x.c:7:11: style: The scope of the variable 'i' can be reduced. [variableScope]
myint i;
^
x.c:8:9: style: The scope of the variable 'n' can be reduced. [variableScope]
int n;
^
I would expect the same message for variables 'en' and 'e' as well.
Does anyone else consider this a bug?
Regards,
Jens
Thanks! I agree. I created a ticket: https://trac.cppcheck.net/ticket/10365