Skip to content
Commit 3e49a19b authored by Chris Friedt's avatar Chris Friedt Committed by Benjamin Cabé
Browse files

scripts: checkpatch: add special consideration for DIR



DIR is a POSIX type defined via the dirent.h header.

In Zephyr, we define it as `typedef void DIR`, since it is only
ever described via a pointer (much like `FILE`).

However, in checkpatch.pl, functions that return DIR* or accept
a DIR* argument are met with an error of the form below:

```
ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
```

Examples that trigger this false positive are, for example

```cpp
int dirfd(DIR *dirp);
DIR *fdopendir(int fd);
```

Include `DIR` as a class of specific POSIX types that should be
matched as types rather than other tokens.

Signed-off-by: default avatarChris Friedt <cfriedt@tenstorrent.com>
parent fa841fe7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment