Skip to content

Commit 9415e38

Browse files
committed
Moving ICC pybind#2196 suppression to CMakeLists.txt
1 parent b978588 commit 9415e38

File tree

6 files changed

+9
-45
lines changed

6 files changed

+9
-45
lines changed

include/pybind11/pybind11.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313
//
1414
// THE `push` HERE NEED TO BE KEPT IN SYNC WITH THE CORRESPONDING `pop` AT THE BOTTOM OF THIS FILE.
1515
//
16-
#if defined(__INTEL_COMPILER)
17-
# pragma warning push
18-
# pragma warning disable 2196 // warning #2196: routine is both "inline" and "noinline"
19-
#elif defined(_MSC_VER)
16+
#if defined(_MSC_VER)
2017
# pragma warning(push)
2118
# pragma warning(disable: 4100) // warning C4100: Unreferenced formal parameter
2219
# pragma warning(disable: 4127) // warning C4127: Conditional expression is constant
@@ -2381,9 +2378,7 @@ PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)
23812378
//
23822379
// THE `pop` HERE NEED TO BE KEPT IN SYNC WITH THE CORRESPONDING `push` AT THE TOP OF THIS FILE.
23832380
//
2384-
#if defined(__INTEL_COMPILER)
2385-
# pragma warning pop
2386-
#elif defined(_MSC_VER)
2381+
#if defined(_MSC_VER)
23872382
# pragma warning(pop)
23882383
#elif defined(__GNUG__) && !defined(__clang__) && !defined(__INTEL_COMPILER)
23892384
# pragma GCC diagnostic pop

tests/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,13 @@ function(pybind11_enable_warnings target_name)
310310
${target_name}
311311
PRIVATE
312312
-Werror-all
313-
# "Inlining inhibited by limit max-size", "Inlining inhibited by limit max-total-size"
314-
-diag-disable 11074,11076)
313+
# 2196: routine is both "inline" and "noinline" (no way to `pop` and not get the warning:
314+
# https://community.intel.com/t5/Intel-C-Compiler/Inline-and-no-inline-warning/td-p/1216764)
315+
# 11074: Inlining inhibited by limit max-size
316+
# 11074: Inlining inhibited by limit max-total-size
317+
# 11076: To get full report use -qopt-report=4 -qopt-report-phase ipo
318+
-diag-disable
319+
2196,11074,11076)
315320
endif()
316321
endif()
317322

tests/constructor_stats.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ inspection/testing in python) by using the functions with `print_` replaced with
7070
#include <typeindex>
7171
#include <sstream>
7272

73-
#if defined(__INTEL_COMPILER)
74-
# pragma warning push
75-
# pragma warning disable 2196 // warning #2196: routine is both "inline" and "noinline"
76-
#endif
77-
7873
class ConstructorStats {
7974
protected:
8075
std::unordered_map<void*, int> _instances; // Need a map rather than set because members can shared address with parents
@@ -278,7 +273,3 @@ template <class T, typename... Values> void print_values(T *inst, Values &&...va
278273
print_constr_details(inst, ":", values...);
279274
track_values(inst, values...);
280275
}
281-
282-
#if defined(__INTEL_COMPILER)
283-
# pragma warning pop
284-
#endif

tests/pybind11_cross_module_tests.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@
1616
#include <numeric>
1717
#include <utility>
1818

19-
#if defined(__INTEL_COMPILER)
20-
# pragma warning push
21-
# pragma warning disable 2196 // warning #2196: routine is both "inline" and "noinline"
22-
#endif
23-
2419
PYBIND11_MODULE(pybind11_cross_module_tests, m) {
2520
m.doc() = "pybind11 cross-module test module";
2621

@@ -154,7 +149,3 @@ PYBIND11_MODULE(pybind11_cross_module_tests, m) {
154149
m.def("missing_header_arg", [](const std::vector<float> &) {});
155150
m.def("missing_header_return", []() { return std::vector<float>(); });
156151
}
157-
158-
#if defined(__INTEL_COMPILER)
159-
# pragma warning pop
160-
#endif

tests/pybind11_tests.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313
#include <functional>
1414
#include <list>
1515

16-
#if defined(__INTEL_COMPILER)
17-
# pragma warning push
18-
# pragma warning disable 2196 // warning #2196: routine is both "inline" and "noinline"
19-
#endif
20-
2116
/*
2217
For testing purposes, we define a static global variable here in a function that each individual
2318
test .cpp calls with its initialization lambda. It's convenient here because we can just not
@@ -94,7 +89,3 @@ PYBIND11_MODULE(pybind11_tests, m) {
9489
for (const auto &initializer : initializers())
9590
initializer(m);
9691
}
97-
98-
#if defined(__INTEL_COMPILER)
99-
# pragma warning pop
100-
#endif

tests/pybind11_tests.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
// We get some really long type names here which causes MSVC 2015 to emit warnings
1111
# pragma warning( \
1212
disable : 4503) // warning C4503: decorated name length exceeded, name was truncated
13-
#elif defined(__INTEL_COMPILER)
14-
# pragma warning push
15-
# pragma warning disable 2196 // warning #2196: routine is both "inline" and "noinline"
1613
#endif
1714

1815
namespace py = pybind11;
@@ -90,9 +87,3 @@ void ignoreOldStyleInitWarnings(F &&body) {
9087
body()
9188
)", py::dict(py::arg("body") = py::cpp_function(body)));
9289
}
93-
94-
#if defined(_MSC_VER) && _MSC_VER < 1910
95-
# pragma warning(pop)
96-
#elif defined(__INTEL_COMPILER)
97-
# pragma warning pop
98-
#endif

0 commit comments

Comments
 (0)