[LLVMbugs] [Bug 13772] New: Casting away qualifiers not warned about

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Sep 5 14:50:00 PDT 2012


             Bug #: 13772
           Summary: Casting away qualifiers not warned about
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: rdivacky at freebsd.org
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

In this example gcc warns about the lose of the const qualifier and clang does

int main() {
  const int *cp; 
  int *p = (int *)cp;

pes ~/openacc$ g++48 -Wcast-qual gcc48-warning.cpp
gcc48-warning.cpp: In function 'int main()':
gcc48-warning.cpp:3:19: warning: cast from type 'const int*' to type 'int*'
casts away qualifiers [-Wcast-qual]
   int *p = (int *)cp;                              
pes ~/openacc$ clang++ -Wcast-qual gcc48-warning.cpp                            
pes ~/openacc$         

Would be lovely to get this implemented.

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