[llvm-bugs] [Bug 52343] New: No warning when dereferencing pointers within a (fixed-size) array

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 29 00:41:19 PDT 2021


            Bug ID: 52343
           Summary: No warning when dereferencing pointers within a
                    (fixed-size) array
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C
          Assignee: unassignedclangbugs at nondot.org
          Reporter: eyalroz1 at gmx.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

Consider the following two functions:

void foo() {
    int *as[2];

void bar() {
    int i = 0;
    int *as[2];

for both of them, a warning should be issued about the dereferencing of an
uninitialized pointer. clang does not issue a warning on any of them when
compiling with -Wall.

See this on GodBolt: https://godbolt.org/z/e98GW679v

Related GCC bug (which does issue a warning for the first function):

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/20211029/0acd566b/attachment-0001.html>

More information about the llvm-bugs mailing list