forked from PaddlePaddle/Paddle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pybind11] Fixed compiling errors for pybind11 `-Wmissing-field-initi…
…alizers` under gcc8 and python312 (PaddlePaddle#63949)
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
diff --git a/include/pybind11/detail/internals.h b/include/pybind11/detail/internals.h | ||
index c1047e4a..e09a6495 100644 | ||
--- a/include/pybind11/detail/internals.h | ||
+++ b/include/pybind11/detail/internals.h | ||
@@ -193,11 +193,18 @@ struct internals { | ||
PyTypeObject *default_metaclass; | ||
PyObject *instance_base; | ||
#if defined(WITH_THREAD) | ||
+#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 8 | ||
+#pragma GCC diagnostic push | ||
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers" | ||
+#endif | ||
// Unused if PYBIND11_SIMPLE_GIL_MANAGEMENT is defined: | ||
PYBIND11_TLS_KEY_INIT(tstate) | ||
# if PYBIND11_INTERNALS_VERSION > 4 | ||
PYBIND11_TLS_KEY_INIT(loader_life_support_tls_key) | ||
# endif // PYBIND11_INTERNALS_VERSION > 4 | ||
+#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 8 | ||
+#pragma GCC diagnostic pop | ||
+#endif | ||
// Unused if PYBIND11_SIMPLE_GIL_MANAGEMENT is defined: | ||
PyInterpreterState *istate = nullptr; |