Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

code will never be executed warning in dictobject.c #118849

Copy link
Copy link
Closed
@sobolevn

Description

@sobolevn
Issue body actions

Bug report

Here's how this code looks right now:

cpython/Objects/dictobject.c

Lines 5489 to 5500 in c3643a1

fail:
di->di_dict = NULL;
Py_DECREF(d);
return -1;
int res;
try_locked:
Py_BEGIN_CRITICAL_SECTION(d);
res = dictiter_iternextitem_lock_held(d, self, out_key, out_value);
Py_END_CRITICAL_SECTION();
return res;
}

gcc -c -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include  -D_Py_TIER2=1 -D_Py_JIT -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include -I/opt/homebrew/opt/openssl/include -I/opt/homebrew/opt/openssl/include  -DPy_BUILD_CORE -o Objects/dictobject.o Objects/dictobject.c
Objects/dictobject.c:5494:5: warning: code will never be executed [-Wunreachable-code]
    int res;
    ^~~~~~~~
1 warning generated.

I have a PR ready.

Linked PRs

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.