Skip to content

-Wuninitialized false positive with foreach objc construct. #9428

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
llvmbot opened this issue Jan 26, 2011 · 4 comments
Closed

-Wuninitialized false positive with foreach objc construct. #9428

llvmbot opened this issue Jan 26, 2011 · 4 comments
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"

Comments

@llvmbot
Copy link
Member

llvmbot commented Jan 26, 2011

Bugzilla Link 9056
Resolution FIXED
Resolved on Jan 26, 2011 20:02
Version trunk
OS All
Attachments Test case
Reporter LLVM Bugzilla Contributor
CC @tkremenek,@nico

Extended Description

The recent merge of -Wuninitialized-experimental with -Wuninitialized introduces a very annoying false positive.

When using the "for in" objc syntax, clang emits a warning.

------------ foreach.m
void test() {
id collection = 0;
for (id obj in collection) {
if (0 == obj)
break;
}
}

clang -fsyntax-only -Wuninitialized foreach.m
foreach.m:4:8: warning: use of uninitialized variable 'obj' [-Wuninitialized]
for (id obj in collection) {
^~~~~~
foreach.m:5:11: note: variable 'obj' is possibly uninitialized when used here
if (0 == obj)
^~~
foreach.m:4:14: note: add initialization to silence this warning
for (id obj in collection) {
^
= 0
1 warning generated.

@tkremenek
Copy link
Contributor

cloned to rdar://problem/8921260

@tkremenek
Copy link
Contributor

*** Bug llvm/llvm-bugzilla-archive#9064 has been marked as a duplicate of this bug. ***

@tkremenek
Copy link
Contributor

Fixed: r124347

@tkremenek
Copy link
Contributor

mentioned in issue llvm/llvm-bugzilla-archive#9064

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
kateinoigakukun pushed a commit to kateinoigakukun/llvm-project that referenced this issue Oct 24, 2024
…e-path-space-fix

[lldb] Support swiftlang tests with nested make invocations on Windows
weliveindetail added a commit to weliveindetail/llvm-project that referenced this issue Nov 5, 2024
weliveindetail added a commit to weliveindetail/llvm-project that referenced this issue Nov 6, 2024
weliveindetail added a commit to weliveindetail/llvm-project that referenced this issue Nov 27, 2024
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"
Projects
None yet
Development

No branches or pull requests

2 participants