Cppcheck 2.10 emits the following (false?) errors on the following code:
main.c:16:19: error: Uninitialized variable: file [uninitvar]
if (fseek(file, 0, SEEK_END) != 0) {
It is worth mentioning, that when i added "#define EXAMPLE_MACRO" to the beginning of the code, everything was ok.
Cppcheck 2.10 emits the following (false?) errors on the following code:
main.c:16:19: error: Uninitialized variable: file [uninitvar]
if (fseek(file, 0, SEEK_END) != 0) {
It is worth mentioning, that when i added "#define EXAMPLE_MACRO" to the beginning of the code, everything was ok.
Thanks!
I have added your example to https://trac.cppcheck.net/ticket/8568
Can you extend the ifdef to cover all of the conditional code?
Do you mean?
For this code, i still see an error:
/tmp/main.c:21:9: error: Uninitialized variable: file [uninitvar]
fclose(file);
Understood, thanks