Skip to content

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

@sobolevn

Description

@sobolevn

Bug report

Here's how this code looks right now:

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

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