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

            Bug ID: 42568
           Summary: Attribute 'noderef' fails to warn in some cases
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangb...@nondot.org
          Reporter: paul_robin...@playstation.sony.com
                CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
                    richard-l...@metafoo.co.uk

C:\TMP>type test.c
struct S {
  int x;
};

struct S __attribute__((noderef)) *s;

void bar() {
  struct S *p = s;  // warned
  int *q = &s->x;   // not warned
  int *r = &(*s).x; // not warned
}

C:\TMP>clang -c test.c
test.c:8:17: warning: casting to dereferenceable pointer removes 'noderef'
      attribute [-Wnoderef]
  struct S *p = s;  // warned
                ^
1 warning generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to