Jon wrote: > I am using Visual C++ 2008 Express Edition. > I don't get any warnings for the Break;, should I?
Victor - you still around? Remember a while back I said 'bool' had issues under VC++? IIRC, 'bool' becomes some sort of weird COM object'ish thing and barfs up wrong values as a result. This could be the same thing only not buried in 100,000 lines of code. Jon, the warning you should be getting is something along the lines of "code is unreachable". The warning indicates that the return statement on the line before exits the function and the following break statement will never, ever execute. The warning level should be high enough (at least /W3) so you don't end up writing code later on that does weird stuff causing you to spend forever debugging that the compiler would have caught and let you know about in the first place. Jon, if you put a breakpoint on the return statements and use F11 to step through the code at the breakpoint, what happens with the 'bool' stuff? Does it immediately return or does the code wander off into "la-la land" when stepping _into_ the return value (COM object code - stuff you probably wouldn't recognize unless you've messed with COM before - hence I'm calling it 'la-la land' for lack of a better description)? There is a chance you've accidentally stumbled upon one of the most bizarre and _unreplicatable_ VC++ bugs I've ever run into. -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* MyTaskFocus 1.1 Get on task. Stay on task. http://www.CubicleSoft.com/MyTaskFocus/
