Closed
Description
Bug report
Bug description:
Hi,
including Python.h with gcc and -Wcast-qual raises the following issue (Regression from 3.12):
/usr/include/python3.13/cpython/pyatomic_gcc.h: In function '_Py_atomic_load_ptr':
/usr/include/python3.13/cpython/pyatomic_gcc.h:300:34: error: cast discards 'const' qualifier from pointer target type [-Werror=cast-qual]
300 | { return (void *)__atomic_load_n((void **)obj, __ATOMIC_SEQ_CST); }
| ^
/usr/include/python3.13/cpython/pyatomic_gcc.h: In function '_Py_atomic_load_ptr_relaxed':
/usr/include/python3.13/cpython/pyatomic_gcc.h:359:34: error: cast discards 'const' qualifier from pointer target xt (line 8))
$ python3.13 -V
Python 3.13.0b1
This is a follow-up to #120293
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs
- gh-120593: Fix const qualifier in pyatomic.h #121052
- gh-120593: Fix const qualifier in _PyLong_CompactValue() #121053
- gh-120593: Fix const qualifier in pyatomic.h #121055
- [3.13] gh-120593: Fix const qualifier in pyatomic.h (GH-121055) #121057
- gh-120593: Check -Wcast-qual flag in test_cext #121081
- gh-120593: Make _PyLong_CompactValue() parameter const again #122367