[llvm-bugs] [Bug 48175] New: missing "uninitialized variable" warning when using VLAs

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 13 12:05:54 PST 2020


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

            Bug ID: 48175
           Summary: missing "uninitialized variable" warning when using
                    VLAs
           Product: clang
           Version: 11.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C
          Assignee: unassignedclangbugs at nondot.org
          Reporter: felix-llvm at fefe.de
                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

Here is some sample code:

int foo(int n) {
  int foo[n];
  return foo[0];
}

Cheeky clang generates only a ret for this function. That's it.

I expected a warning that I am reading an uninitialized value in the return
statement.

-- 
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/20201113/e24f20db/attachment.html>


More information about the llvm-bugs mailing list