[LLVMbugs] [Bug 3935] New: Invalid addresses at compile time not diagnosed

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat Apr 4 07:20:58 PDT 2009


http://llvm.org/bugs/show_bug.cgi?id=3935

           Summary: Invalid addresses at compile time not diagnosed
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: NetBSD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Semantic Analyzer
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: neil at daikokuya.co.uk
                CC: llvmbugs at cs.uiuc.edu


Clang should diagnose invalid address compuatations; e.g. 

    int x[2], *y = &x[3], *z = x + 3;

Clang accepts this without comment.  Comeau gives

"ComeauTest.c", line 1: warning: subscript out of range
  int x[2], *y = &x[3], *z = x + 3;
                   ^

"ComeauTest.c", line 1: warning: pointer points outside of underlying object
  int x[2], *y = &x[3], *z = x + 3;
                               ^

This catches many bugs at compile time.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list