http://llvm.org/bugs/show_bug.cgi?id=7413

           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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to