You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use defined for some preprocessor variables that might be undefined
The variables PYBIND11_HAS_OPTIONAL, PYBIND11_HAS_EXP_OPTIONAL, PYBIND11_HAS_VARIANT,
__clang__, __APPLE__ were not checked for defined in a minortity of instances.
If the project using pybind11 sets -Wundef, the warnings will show.
The test build is also modified to catch the problem.
The errors looked like:
```
ext/pybind11/include/pybind11/stl.h:292:5: error: "PYBIND11_HAS_OPTIONAL" is not defined, evaluates to 0 [-Werror=undef]
292 | #if PYBIND11_HAS_OPTIONAL
| ^~~~~~~~~~~~~~~~~~~~~
ext/pybind11/include/pybind11/stl.h:300:5: error: "PYBIND11_HAS_EXP_OPTIONAL" is not defined, evaluates to 0 [-Werror=undef]
300 | #if PYBIND11_HAS_EXP_OPTIONAL
| ^~~~~~~~~~~~~~~~~~~~~~~~~
ext/pybind11/include/pybind11/stl.h:372:5: error: "PYBIND11_HAS_VARIANT" is not defined, evaluates to 0 [-Werror=undef]
372 | #if PYBIND11_HAS_VARIANT
| ^~~~~~~~~~~~~~~~~~~~
```
0 commit comments