21 Apr
2006
21 Apr
'06
9:28 p.m.
Doug Gregor wrote:
On Apr 21, 2006, at 8:26 AM, Howard Gardner wrote:
/* This doesn't work. Is it supposed to?
If "broken" returns a "ret< int >" or an "x", then it does seem to work right.
In case it's a known compiler issue, I'm using:
Comeau C/C++ 4.3.3 (Aug 10 2003 15:39:53) for _MS_WINDOWS_x86_Beta8
It works for me on GCC 4.0.1, except that I need to change <ostream> to <iostream> (GCC bug, I believe). What error are you getting?
Doug
It ought to print: 42 It actually prints: 2292991 I can deliberately change what's on the stack, and it will print a different value. It looks like an uninitialized variable bug.