mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 13:15:12 +00:00
Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135)
* Fixing `pragma warning pop` for `__INTEL_COMPILER`. * Adding push/pop to 3 tests. Removing #878 from top of pybind11.h (it was/is only needed for 1 test). * Trying again after CI failure, moving the push to the top of 2 tests. * Trying more after CI failure, adding push/pop to pybind11_tests.h, constructor_stats.h. * Moving ICC #2196 suppression to CMakeLists.txt * Fixing condition for `pragma GCC diagnostic push` in pybind11.h * Moving `pragma warning disable 2196` to common.h * Revising #ifdef to be more conservative. * Undoing insertion of notes that will hopefully soon be completely obsolete anyway.
This commit is contained in:
parent
9beaa925db
commit
2164c2e0e7
@ -56,6 +56,9 @@
|
|||||||
# elif __INTEL_COMPILER < 1900 && defined(PYBIND11_CPP14)
|
# elif __INTEL_COMPILER < 1900 && defined(PYBIND11_CPP14)
|
||||||
# error pybind11 supports only C++11 with Intel C++ compiler v18. Use v19 or newer for C++14.
|
# error pybind11 supports only C++11 with Intel C++ compiler v18. Use v19 or newer for C++14.
|
||||||
# endif
|
# endif
|
||||||
|
/* The following pragma cannot be pop'ed:
|
||||||
|
https://community.intel.com/t5/Intel-C-Compiler/Inline-and-no-inline-warning/td-p/1216764 */
|
||||||
|
# pragma warning disable 2196 // warning #2196: routine is both "inline" and "noinline"
|
||||||
#elif defined(__clang__) && !defined(__apple_build_version__)
|
#elif defined(__clang__) && !defined(__apple_build_version__)
|
||||||
# if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 3)
|
# if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 3)
|
||||||
# error pybind11 requires clang 3.3 or newer
|
# error pybind11 requires clang 3.3 or newer
|
||||||
|
@ -10,16 +10,12 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if defined(__INTEL_COMPILER)
|
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
|
||||||
# pragma warning push
|
|
||||||
# pragma warning disable 878 // incompatible exception specifications
|
|
||||||
# pragma warning disable 2196 // warning #2196: routine is both "inline" and "noinline"
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
# pragma warning(push)
|
# pragma warning(push)
|
||||||
# pragma warning(disable: 4100) // warning C4100: Unreferenced formal parameter
|
# pragma warning(disable: 4100) // warning C4100: Unreferenced formal parameter
|
||||||
# pragma warning(disable: 4127) // warning C4127: Conditional expression is constant
|
# pragma warning(disable: 4127) // warning C4127: Conditional expression is constant
|
||||||
# pragma warning(disable: 4505) // warning C4505: 'PySlice_GetIndicesEx': unreferenced local function has been removed (PyPy only)
|
# pragma warning(disable: 4505) // warning C4505: 'PySlice_GetIndicesEx': unreferenced local function has been removed (PyPy only)
|
||||||
#elif defined(__GNUG__) && !defined(__clang__)
|
#elif defined(__GNUG__) && !defined(__clang__) && !defined(__INTEL_COMPILER)
|
||||||
# pragma GCC diagnostic push
|
# pragma GCC diagnostic push
|
||||||
# pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
|
# pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
|
||||||
# pragma GCC diagnostic ignored "-Wattributes"
|
# pragma GCC diagnostic ignored "-Wattributes"
|
||||||
|
@ -133,7 +133,14 @@ TEST_SUBMODULE(constants_and_functions, m) {
|
|||||||
;
|
;
|
||||||
m.def("f1", f1);
|
m.def("f1", f1);
|
||||||
m.def("f2", f2);
|
m.def("f2", f2);
|
||||||
|
#if defined(__INTEL_COMPILER)
|
||||||
|
# pragma warning push
|
||||||
|
# pragma warning disable 878 // incompatible exception specifications
|
||||||
|
#endif
|
||||||
m.def("f3", f3);
|
m.def("f3", f3);
|
||||||
|
#if defined(__INTEL_COMPILER)
|
||||||
|
# pragma warning pop
|
||||||
|
#endif
|
||||||
m.def("f4", f4);
|
m.def("f4", f4);
|
||||||
|
|
||||||
// test_function_record_leaks
|
// test_function_record_leaks
|
||||||
|
Loading…
Reference in New Issue
Block a user