Skip to content

Commit 5b05582

Browse files
committed
Ignore pedantic warnings on PySlot
1 parent 9bed8d3 commit 5b05582

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Lib/test/test_cppext/extension.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,14 @@ _testcppext_exec(PyObject *module)
325325
PyDoc_STRVAR(_testcppext_doc, "C++ test extension.");
326326
PyABIInfo_VAR(abi_info);
327327

328+
// Need to ignore "-Wpedantic" warnings; see VirtualPyObject_Slots above
329+
_Py_COMP_DIAG_PUSH
330+
#if defined(__GNUC__)
331+
#pragma GCC diagnostic ignored "-Wpedantic"
332+
#elif defined(__clang__)
333+
#pragma clang diagnostic ignored "-Wpedantic"
334+
#endif
335+
328336
static PySlot _testcppext_slots[] = {
329337
PySlot_PTR_STATIC(Py_mod_abi, &abi_info),
330338
PySlot_PTR_STATIC(Py_mod_name, (void*)STR(MODULE_NAME)),
@@ -335,6 +343,8 @@ static PySlot _testcppext_slots[] = {
335343
PySlot_END,
336344
};
337345

346+
_Py_COMP_DIAG_POP
347+
338348

339349
#define _FUNC_NAME(NAME) PyModExport_ ## NAME
340350
#define FUNC_NAME(NAME) _FUNC_NAME(NAME)

0 commit comments

Comments
 (0)