Hi, I found inconsistent behavior in Cppcheck when analyzing the following two equivalent programs.
Cppcheck reports a warning for the first program, but no warning for the second one. I believe this is a false negative.
First Program with a Warning
#include <stdio.h> int main() { const FILE *a = fopen("good.c", "r"); if (!a) return 0; return 0; }
Second Program without Warnings
#include <stdio.h> int main() { const auto a = fopen("good.c", "r"); if (!a) return 0; return 0; }
Version: Cppcheck 2.22 dev
Thanks for reporting, see https://trac.cppcheck.net/ticket/14834
Log in to post a comment.
Hi, I found inconsistent behavior in Cppcheck when analyzing the following two equivalent programs.
Cppcheck reports a warning for the first program, but no warning for the second one. I believe this is a false negative.
First Program with a Warning
Second Program without Warnings
Version: Cppcheck 2.22 dev
Thanks for reporting, see https://trac.cppcheck.net/ticket/14834