[issue18407] Fix compiler warnings in pythoncore for Win64

Jeremy Kloth report at bugs.python.org
Mon Jul 8 22:57:26 CEST 2013


Jeremy Kloth added the comment:

The change in grammar.c:addlabel() is correct.  The return value is an
index into the ll->ll_label array, thus an int.  The code could be
rewritten to avoid the pointer addition by saving the value of
ll->ll_nlabels before it is incremented and return that instead,

On Mon, Jul 8, 2013 at 1:23 PM, STINNER Victor <report at bugs.python.org> wrote:
>
> STINNER Victor added the comment:
>
> This issue duplicates the isuse #9566, but your patch is interesting. I created other more specific issues like #18295 and #18294.
>
> -    return lb - ll->ll_label;
> +    return Py_SAFE_DOWNCAST(lb - ll->ll_label, Py_intptr_t, int);
>
> I don't think that such change is correct, IMO the right fix is to change the result type to Py_intptr_t.
>
> ----------
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <http://bugs.python.org/issue18407>
> _______________________________________

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18407>
_______________________________________


More information about the Python-bugs-list mailing list