[llvm-bugs] [Bug 42625] New: Uninitialized warning missing for struct member access inside GNU C statement expression

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jul 15 10:32:09 PDT 2019


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

            Bug ID: 42625
           Summary: Uninitialized warning missing for struct member access
                    inside GNU C statement expression
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nhuck15 at gmail.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Probable duplicate of https://bugs.llvm.org/show_bug.cgi?id=42610

Consider the following

struct widget {
    int x,y;
};

void bar_bad(void) {
  struct widget my_widget = ({
    int x = my_widget.x; // There should be a warning about x here
    init2(&my_widget);
    my_widget;
  });
}

When compiled with -Wuninitialized there is no warning on x.

-- 
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/20190715/46c75dce/attachment-0001.html>


More information about the llvm-bugs mailing list