<Figured Rob would never get an off-list reply because of an invalid address... sending the reply here>
On Thu, Dec 02, 2004 at 11:27:24AM +0000, Richard Tobin probably wrote: > > IIRC "const" does not exist in *standardized* C... > > No, it exists in both C89 and C99. But the error is in your program, > not the compiler. "const" in C is a promise that you do not change > the value, and you break that promise. > > It may be different in C++, I don't know. In C, your promise is a promise to yourself only. In C++, the compiler believes your promise and optimizes out the variable so that printf(...,n) becomes printf(...,0). C++ is intendedly so `gullible' to make more aggressive optimizations (like this) possible. Try turning off optimizations for g++ to see if that `helps', but the code is not valid C++ anyway. HTH, -- DoubleF A LISP programmer knows the value of everything, but the cost of nothing.
pgpZOAtF8hdlR.pgp
Description: PGP signature