egcs-2.91.55 19980824 error on const references

Hyman Rosen hymie@prolifics.com
Tue Aug 25 07:28:00 GMT 1998


configure --enable-shared --enable-threads

on both

Linux calumny 2.0.35 #1 Tue Jul 21 15:44:54 EDT 1998 i686 unknown
SunOS yanx 5.5.1 Generic_103640-18 sun4u sparc SUNW,Ultra-2

The following test program fails. It also fails in all earlier versions
of gcc. Would someone please add it to the test suite?

I don't mean to be obnoxious, but I'm going to keep on reporting this
until someone out there fixes it, or adds a test case for it, or at
least acknowledges its existence.

extern "C" int printf(const char *, ...);
int main(int, char **)
{
	volatile const int c = 42;
	volatile int *p;
	volatile const int *&r = p;
	r = &c;
	*p = 0;
	if (c != 42)
		printf("FAILED!\n");
}



More information about the Gcc mailing list