Skip to content

Commit 4239aed

Browse files
committed
Making -Wattributes pragma in pybind11 specific to GCC7, GCC8, CUDA.
1 parent 0e2f724 commit 4239aed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/pybind11/pybind11.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#pragma once
1212

13-
#if defined(__GNUG__) && !defined(__clang__) && !defined(__INTEL_COMPILER)
13+
#if defined(__CUDACC__) || (defined(__GNUC__) && (__GNUC__ == 7 || __GNUC__ == 8))
1414
# pragma GCC diagnostic push
1515
# pragma GCC diagnostic ignored "-Wattributes"
1616
#endif
@@ -2384,6 +2384,6 @@ PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)
23842384
# pragma GCC diagnostic pop // -Wnoexcept-type
23852385
#endif
23862386

2387-
#if defined(__GNUG__) && !defined(__clang__) && !defined(__INTEL_COMPILER)
2387+
#if defined(__CUDACC__) || (defined(__GNUC__) && (__GNUC__ == 7 || __GNUC__ == 8))
23882388
# pragma GCC diagnostic pop
23892389
#endif

0 commit comments

Comments
 (0)