[Bug c++/35711] New: bad text in -Wcast-qual warning (forgets volatile)
sebor at roguewave dot com
gcc-bugzilla@gcc.gnu.org
Wed Mar 26 20:14:00 GMT 2008
The text of the warning below is incorrect and misleading -- the cast
actually casts away the volatile qualifier, not constness. The warning
is misleading when the type of the source is both const and volatile
qualified.
$ cat t.cpp && g++ -c -Wcast-qual t.cpp
int* foo (volatile int *p)
{
return (int*)p;
}
t.cpp: In function Âint* foo(volatile int*)Â:
t.cpp:3: warning: cast from type Âvolatile int*Â to type Âint*Â casts away
constness
--
Summary: bad text in -Wcast-qual warning (forgets volatile)
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sebor at roguewave dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35711
More information about the Gcc-bugs
mailing list