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:
Chris Friedt <cfriedt@tenstorrent.com>
Loading
Please sign in to comment