Description
Bug
off_t
lives under <sys/types.h>
for Linux platforms. However, on MacOS platforms, this is not the case, and clang-tidy
will generate misc-include-cleaner
warnings.
2 warnings treated as errors
/Users/runner/work/ystdlib-cpp/ystdlib-cpp/src/ystdlib/io_interface/StreamInterface.hpp:4:1: error: included header types.h is not used directly [misc-include-cleaner,-warnings-as-errors]
4 | #include <sys/types.h>
| ^~~~~~~~~~~~~~~~~~~~~~
5 |
/Users/runner/work/ystdlib-cpp/ystdlib-cpp/src/ystdlib/io_interface/StreamInterface.hpp:55:50: error: no header providing "off_t" is directly included [misc-include-cleaner,-warnings-as-errors]
4 | [[nodiscard]] virtual auto seek_from_current(off_t offset)
| ^
task: Failed to run task "lint:check": exit status 1
This issue is first encountered when clang-tidying the ReaderInterface
and WriterInterface
classes in the io_interface
library (#49). We've left NOLINT
s and TODO
s in the code to silence the warnings.
One solution is to create our own versions of the system headers for portability and platform-specific handling. See also.
ystdlib-cpp version
0.0.0
Environment
Warnings generated on MacOS-15.
Reproduction steps
Remove the NOLINT
lines added in (#49), and run clang-tidy
on MacOS-15.