https://llvm.org/bugs/show_bug.cgi?id=26468

            Bug ID: 26468
           Summary: -Wuninitialized warning on empty struct
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: hjl.to...@gmail.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

[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?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to