[LLVMbugs] [Bug 8718] New: No warning on casting between pointer and non-pointer-sized int

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Dec 1 10:56:31 PST 2010


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

           Summary: No warning on casting between pointer and
                    non-pointer-sized int
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: tjw at omnigroup.com
                CC: llvmbugs at cs.uiuc.edu


llvm-gcc-4.2 and gcc-4.2 correctly report warnings when casting between
pointers and integer types of non-pointer width:

  llvm-gcc-4.2  -Wall -c int-ptr-cast-size-mismatch.c -o /tmp/x
  int-ptr-cast-size-mismatch.c: In function ‘cast_from_pointer’:
  int-ptr-cast-size-mismatch.c:4: warning: cast from pointer to integer of
different size
  int-ptr-cast-size-mismatch.c: In function ‘cast_to_pointer’:
  int-ptr-cast-size-mismatch.c:9: warning: cast to pointer from integer of
different size

  clang, as shipped in Xcode 3.2.5 and from trunk r120583, reports no warnings,
however.

-- 
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