test.h
enum Type
{
ERROR
};
struct A
{
};
test.cpp
#include "test.h"
extern void f()
{
A a; // unusedVariable
}
In Cppcheck 2.4 the header will generate a syntaxError with the Windows version:
test.h:1:1: error: syntax error [syntaxError]
enum Type
^
This leads to the unusedVariable in function f() not being reported making it seems like a false negative since the syntaxError is being suppressed as it didn't occur in the file we are analyzing.
We need to make this error visible - possibly via a global warning about this.
There's most likely other errors which may lead to the same problem.