https://bugs.llvm.org/show_bug.cgi?id=52428
Bug ID: 52428
Summary: No uninitialized variable warning for value captured
by block.
Product: clang
Version: 13.0
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: C
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected],
[email protected]
```
// Test.c
int main(void)
{
uint32_t status;
int token;
status = notify_register_dispatch("com.eg.random.event", &token,
dispatch_get_main_queue(), ^(int t) {
uint64_t state;
notify_get_state(token, &state);
printf("com.eg.random.event! %lld\n", state);
});
dispatch_main();
exit(0);
}
--------------
clang test.c -Wuninitialized -Wconditional-uninitialized -Wall
```
I would expect there to be an uninitialized warning for token where it is
captured by the block. The code is wrong and I should be using `t` inside the
block but it's really easy to make an error here.d
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs