Skip to content

New warning: Python/gc.c:1294:20: warning: variable 'count' set but not used [-Wunused-but-set-variable] #120966

@Eclips4

Description

@Eclips4

Bug report

Bug description:

Interpreter was built with --with-pydebug --enable-pystats:

Python/gc.c:1294:20: warning: variable 'count' set but not used [-Wunused-but-set-variable]
        Py_ssize_t count = 0;
                   ^

This is refers to this code:

cpython/Python/gc.c

Lines 1292 to 1300 in 375b723

#ifdef Py_STATS
{
Py_ssize_t count = 0;
PyGC_Head *gc;
for (gc = GC_NEXT(young); gc != young; gc = GC_NEXT(gc)) {
count++;
}
}
#endif

I guess that the variable count is should be written to some variable related to stats?
cc @markshannon

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions