8000 New warning on GitHub: "unused variable ‘runtime’ in `pystate.c`" · Issue #101181 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

New warning on GitHub: "unused variable ‘runtime’ in pystate.c" #101181

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

Closed
sobolevn opened this issue Jan 20, 2023 · 4 comments
Closed

New warning on GitHub: "unused variable ‘runtime’ in pystate.c" #101181

sobolevn opened this issue Jan 20, 2023 · 4 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member
sobolevn commented Jan 20, 2023

All PRs right now show this warning:
Снимок экрана 2023-01-20 в 10 55 11

However, it looks like a false-positive, because runtime is clearly used later on:

cpython/Python/pystate.c

Lines 1881 to 1885 in 3fa8fe7

_PyRuntimeState *runtime = tstate->interp->runtime;
assert(runtime->gilstate.autoInterpreterState == tstate->interp);
assert(current_tss_get(runtime) == tstate);
assert(tstate->gilstate_counter == 1);

Looks like it has started after 6036c3e

cc @ericsnowcurrently

Linked PRs

@sobolevn sobolevn added type-bug An unexpected behavior, bug, or error interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Jan 20, 2023
@kumaraditya303
Copy link
Contributor

The block needs to be guarded with NDEBUG, want to make a PR for it?

@sobolevn sobolevn self-assigned this Jan 20, 2023
@sobolevn
Copy link
Member Author

Working on it.

@ericsnowcurrently
Copy link
Member

Thanks, @sobolevn!

kumaraditya303 added a commit that referenced this issue Jan 20, 2023
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
@sobolevn
Copy link
Member Author

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants
0