Skip to content

Conversation

@pablogsal
Copy link
Member

@pablogsal pablogsal commented Apr 28, 2020

@pablogsal pablogsal force-pushed the bpo-40334-warnings branch from b465e57 to edb3f4b Compare April 29, 2020 00:07
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

The other option is to change Token structure to use Py_ssize_t. But it would require to modify Python-ast.c to accept line number and column as Py_ssize_t as well. And then fix further issues of code using int, etc. I'm not sure that we have to support lines longer than 2 GB.

The previous person who made the warning quiet didn't try to raise an error for a line longer than 2 GB:

commit cad876d54273e6f3f9cb3ff575da1c45ef5410c6
Author: Victor Stinner <[email protected]>
Date:   Mon Nov 18 01:09:51 2013 +0100

    Fix a compiler warning on Windows 64-bit in parsetok.c
    
    Python parser doesn't support lines longer than INT_MAX bytes yet

@pablogsal pablogsal closed this Apr 29, 2020
@pablogsal pablogsal reopened this Apr 29, 2020
@pablogsal pablogsal changed the title bpo-40334: Use Py_SAFE_DOWNCAST when casting size_t to int in pegen.c bpo-40334: Explicitly cast to int in pegen.c Apr 29, 2020
@pablogsal pablogsal changed the title bpo-40334: Explicitly cast to int in pegen.c bpo-40334: Explicitly cast to int in pegen.c to fix a compiler warning Apr 29, 2020
@pablogsal pablogsal merged commit 2208134 into python:master Apr 29, 2020
@pablogsal pablogsal deleted the bpo-40334-warnings branch April 29, 2020 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants