[LLVMbugs] [Bug 7413] New: Missing-field-initializers warning for empty braces

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jun 18 14:00:30 PDT 2010


           Summary: Missing-field-initializers warning for empty braces
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: tronic+hfu3 at trn.iki.fi
                CC: llvmbugs at cs.uiuc.edu

No warning should be issued when initializing with empty braces but instead
only when explicitly initializing one or more fields (but not all of them).

Compile the following with -Wextra:

struct Foo { int a, b, c; };

int main(void) {
    struct Foo foo = {};  // Default-initialize all fields of foo
    return foo.a;

Affects both C and C++. Default initialization documented in C++98 §8.5.1
paragraph 7 and C99 §6.7.8 paragraph 21.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list