diff --git a/src/wrap_cl.hpp b/src/wrap_cl.hpp
index 1314a1563d0e9dcd466eb91b3e5b40c663f21608..a20f2f0f77003aad2a127e36be99e0b61bc241a1 100644
--- a/src/wrap_cl.hpp
+++ b/src/wrap_cl.hpp
@@ -745,7 +745,16 @@ namespace pyopencl
             }
           case CL_DEVICE_PARTITION_AFFINITY_DOMAIN:
             {
+#if defined(__GNUG__) && !defined(__clang__)
+#pragma GCC diagnostic push
+// what's being ignored here is an alignment attribute to native size, which
+// shouldn't matter on the relevant ABIs that I'm aware of.
+#pragma GCC diagnostic ignored "-Wignored-attributes"
+#endif
               std::vector<cl_device_affinity_domain> result;
+#if defined(__GNUG__) && !defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
               PYOPENCL_GET_VEC_INFO(Device, m_device, param_name, result);
               PYOPENCL_RETURN_VECTOR(cl_device_affinity_domain, result);
             }