[llvm-bugs] [Bug 39931] New: False positive on -Wmissing-braces for structure with non-integer subobject

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Dec 9 09:39:48 PST 2018


            Bug ID: 39931
           Summary: False positive on -Wmissing-braces for structure with
                    non-integer subobject
           Product: clang
           Version: 7.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: peter at lekensteyn.nl
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

When the first subobject of a structure within another structure is not a
signed integer (e.g. unsigned integer, char, short, long), it triggers a
-Wmissing-braces warning.


 struct s1 {
    short f1;  // "int f1" is fine.
 struct s2 {
    struct s1 f2;
    int x;
 struct s2 x = {0};
 // warning: suggest braces around initialization of subobject

An earlier issue with the "universal zero initializer" was resolved with bug
21689 (Clang 6), but this one still remains.

Found in:
clang 7.0.0-1 (Arch Linux)
clang version 8.0.0 (trunk 348720) (llvm/trunk 348724)

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181209/a2264a66/attachment.html>

More information about the llvm-bugs mailing list