Skip to content
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

gh-118849: Fix "code will never be executed" warning in dictobject.c #118850

Merged
merged 2 commits into from
May 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Objects/dictobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -5491,13 +5491,12 @@
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);
int res = dictiter_iternextitem_lock_held(d, self, out_key, out_value);

Check warning on line 5496 in Objects/dictobject.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test

unused variable ‘res’ [-Wunused-variable]
Py_END_CRITICAL_SECTION();
return res;

Check failure on line 5498 in Objects/dictobject.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'res': undeclared identifier [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 5498 in Objects/dictobject.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

'res': undeclared identifier [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 5498 in Objects/dictobject.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test

‘res’ undeclared (first use in this function)
}

Check warning on line 5499 in Objects/dictobject.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test

control reaches end of non-void function [-Wreturn-type]

#endif

Expand Down
Loading