Skip to content

Commit

Permalink
Guard redundant declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaschke committed Feb 18, 2025
1 parent 1d81094 commit 705d468
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/pybind11/detail/class.h
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,13 @@ extern "C" inline void pybind11_object_dealloc(PyObject *self) {
Py_DECREF(type);
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wredundant-decls"

std::string error_string();

#pragma GCC diagnostic pop

/** Create the type which can be used as a common base for all classes. This is
needed in order to satisfy Python's requirements for multiple inheritance.
Return value: New reference. */
Expand Down
8 changes: 8 additions & 0 deletions include/pybind11/gil.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)

PYBIND11_NAMESPACE_BEGIN(detail)

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wredundant-decls"

// forward declarations
PyThreadState *get_thread_state_unchecked();

#pragma GCC diagnostic pop

PYBIND11_NAMESPACE_END(detail)

#if !defined(PYBIND11_SIMPLE_GIL_MANAGEMENT)
Expand Down

0 comments on commit 705d468

Please sign in to comment.