Open polluks opened 1 year ago
$ cppcheck -q -v . --enable=all -DHAVE_OPENVZ
Actually there's no need to pass any flags, as all flags are provided via config.h
. Additional flags should, if given, align with what make
passes to gcc
in CFLAGS
.
[Process.h:26]: (error) syntax error
cppcheck doesn't understand proper C99 syntax …
[freebsd/FreeBSDProcessList.c:464]: (error) Array 'jiov[4]' accessed at index 4, which is out of bounds.
Please elaborate where this access should be … I think that's another false-positive from CPPCheck …
[generic/fdstat_sysctl.c:81]: (error) #error Unknown platform: Please implement proper way to query open/max file information
This is intentional as generic/fdstat_sysctl.c
is not used on platforms that don't need it (like FreeBSD) … Have a look at Makefile.am
for details …
[linux/LinuxProcessList.c:108]: (style) The scope of the variable 'nibble' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops.
When you see this message it is always safe to reduce the variable scope 1 level.
[linux/LinuxProcessList.c:108]: (style) The scope of the variable 'letter' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops.
When you see this message it is always safe to reduce the variable scope 1 level.
Intentional and not a bug to have that variable visible for the whole function lifetime. Also common paradigm for C89/C99. Not reducing the scope of those two variables makes the code actually more readable IMO.