This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: egcs-2.91.55 19980824 error on const references


On Tue, 25 Aug 1998, Hyman Rosen wrote:

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

You mean it "fails to keep c constant"?  Without the `const's, that code
_should_ assign 0 to `c'.  If the const should be errored about, then the
failure is not reporting the const error.

What is the defined behavior with "volatile const"?  Is it defined as the
same as "volatile"--that is, no const behavior at all?

FWIW, the SunPro C++ for Solaris is the same as gcc/egcs.

: 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");
: }

-- 
-- Todd Vierling (Personal tv@pobox.com; Bus. todd_vierling@xn.xerox.com)



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]