-Wuninitialized warning on empty struct #26842
Labels
bugzilla
Issues migrated from bugzilla
c
clang:diagnostics
New/improved warning or error message in Clang, but not in clang-tidy or static analyzer
confirmed
Verified by a second party
false-positive
Warning fires when it should not
Extended Description
[hjl@gnu-6 empty-2]$ cat x.c
struct empty {};
struct empty
foo (void)
{
struct empty s;
return s;
}
[hjl@gnu-6 empty-2]$ make
/export/build/gnu/llvm-clang-bootstrap/stage1/build-x86_64-linux/bin/clang -m32 -S -O -Wall x.c
x.c:7:10: warning: variable 's' is uninitialized when used here
[-Wuninitialized]
return s;
^
x.c:6:3: note: variable 's' is declared here
struct empty s;
^
1 warning generated.
[hjl@gnu-6 empty-2]$
Shouldn't empty struct be a special case here?
The text was updated successfully, but these errors were encountered: