Skip to content

[2.7] ceval.c: mark debug 'filename' variable as unused #11074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 10, 2018
Merged

[2.7] ceval.c: mark debug 'filename' variable as unused #11074

merged 1 commit into from
Dec 10, 2018

Conversation

vstinner
Copy link
Member

Use GCC attribute((unused)) to mark the debug variable 'filename'
as unused in Python/ceval.c.

Use GCC __attribute__((unused)) to mark the debug variable 'filename'
as unused in Python/ceval.c.
@vstinner vstinner changed the title ceval.c: mark debug 'filename' variable as unused [2.7] ceval.c: mark debug 'filename' variable as unused Dec 10, 2018
@serhiy-storchaka
Copy link
Member

If it is unused, why not just remove it?

@vstinner
Copy link
Member Author

If it is unused, why not just remove it?

See the comment:

    /* Make it easier to find out where we are with a debugger */
    char *filename;

It's an helper to be able to read directly the current filename easy in a debugger. Without this variable, you have to inspect co->co_filename PyStringObject object to get its ob_sval attribute. I think that this variable is useful. It's only defined with Python is compiled in debug mode.

@vstinner vstinner merged commit 1fd93ff into python:2.7 Dec 10, 2018
@vstinner vstinner deleted the ceval_filename branch December 10, 2018 12:53
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