[New-bugs-announce] [issue43412] object.h -Wcast-qual warning

Peter Eisentraut report at bugs.python.org
Fri Mar 5 17:12:41 EST 2021


New submission from Peter Eisentraut <peter at eisentraut.org>:

object.h contains an inline function that causes a -Wcast-qual warning from gcc.  Since this file ends up visible in third-party code that includes Python.h, this makes it impossible to use -Wcast-qual in such code.

The problem is the change c5cb077ab3c88394b7ac8ed4e746bd31b53e39f1, which replaced ob->ob_type by Py_TYPE(ob), which seems reasonable by itself, but Py_TYPE casts away the const, so it creates this problem.

This is a regression in Python 3.10.

----------
components: Interpreter Core
messages: 388167
nosy: petere
priority: normal
severity: normal
status: open
title: object.h -Wcast-qual warning
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43412>
_______________________________________


More information about the New-bugs-announce mailing list