File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -58,11 +58,24 @@ _testcext_exec(
5858 return 0 ;
5959}
6060
61+ // Converting from function pointer to void* has undefined behavior, but
62+ // works on all known platforms, and CPython's module and type slots currently
63+ // need it.
64+ // (GCC doesn't have a narrower category for this than -Wpedantic.)
65+ _Py_COMP_DIAG_PUSH
66+ #if defined(__GNUC__ )
67+ #pragma GCC diagnostic ignored "-Wpedantic"
68+ #elif defined(__clang__ )
69+ #pragma clang diagnostic ignored "-Wpedantic"
70+ #endif
71+
6172static PyModuleDef_Slot _testcext_slots [] = {
6273 {Py_mod_exec , (void * )_testcext_exec },
6374 {0 , NULL }
6475};
6576
77+ _Py_COMP_DIAG_POP
78+
6679
6780PyDoc_STRVAR (_testcext_doc , "C test extension .");
6881
Original file line number Diff line number Diff line change 2121
2222 # gh-120593: Check the 'const' qualifier
2323 '-Wcast-qual' ,
24+
25+ # Ask for strict(er) compliance with the standard
26+ '-pedantic-errors' ,
2427 ]
2528 if not support .Py_GIL_DISABLED :
2629 CFLAGS .append (
You can’t perform that action at this time.
0 commit comments