Skip to content

Commit

Permalink
IWYU cleanup
Browse files Browse the repository at this point in the history
```
iwyu version: include-what-you-use 0.17 based on Debian clang version 13.0.1-3+build2
```

Command used:

```
iwyu -c -std=c++17 -DPYBIND11_TEST_BOOST -Iinclude/pybind11 -I/usr/include/python3.9 -I/usr/include/eigen3 include/pybind11/pytypes.cpp
```

pytypes.cpp is a temporary file: `#include "pytypes.h"`

The raw output is very long and noisy.

I decided to use `#include <cstddef>` instead of `#include <cstdio>` for `std::size_t` (iwyu sticks to the manual choice).

I ignored all iwyu suggestions that are indirectly covered by `#include <Python.h>`.

I manually verified that all added includes are actually needed.
  • Loading branch information
Ralf W. Grosse-Kunstleve committed Jun 2, 2022
1 parent 53e29f4 commit 8e145c0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion include/pybind11/pytypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
#include "detail/common.h"
#include "buffer_info.h"

#include <cstdio>
#include <assert.h>
#include <cstddef>
#include <exception>
#include <frameobject.h>
#include <iterator>
#include <memory>
#include <string>
#include <type_traits>
#include <typeinfo>
#include <utility>

#if defined(PYBIND11_HAS_OPTIONAL)
Expand Down

0 comments on commit 8e145c0

Please sign in to comment.