johnthagen / johnthagen/clion-cppcheck

`syntaxError` in include is hidden - leading to suspected false negative

Open
#74 4 comments 0 reactions 1 assignee Claimed by @firewave View on GitHub
Dominant language
Java
Stars
35
Forks
6
PR merge metrics
No merged PRs in 30d

Description

`test.h`
```cpp
enum Type
{
ERROR
};

struct A
{
};
```

`test.cpp`
```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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.