Skip to content

syntaxError in include is hidden - leading to suspected false negative #74

@firewave

Description

@firewave

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions