bugreport(egcs19990502):static_cast casting away const

Alfred Minarik a8601248@unet.univie.ac.at
Sun May 16 06:27:00 GMT 1999

static_cast casts away const from const void*,
but to my knowlede const void* is not special:
The error is not detected for any target pointer type not just int* !
int main() {
	const int i=10;
	const void* a=&i;
	int* p=static_cast<int*>(a); //bug:casting away const not detected
	return 0;
%uname -a
Linux pc 2.2.5 #3 Sat May 8 09:27:54 MEST 1999 i686 unknown
%g++ -v
Reading specs from
gcc version egcs-2.93.21 19990502 (gcc2 ss-980929 experimental)
.)build: (from memory)
%home/am/gcc/egcs_current/egcs-19990502/configure \
--prefix=/home/am/gcc/egcs_current/usr \
--enable-shared --with-gnu-as --with-gnu-ld
%make bootstrap
%make install
%g++ bug.cpp
same with egcs1.1.2


More information about the Gcc-bugs mailing list