Hi,
Back on RC1 I mentioned a possible bug using optimizations. V10 was/is giving me different results compared to V9. I have a small portion of code, from a huge program, that either demonstrates the possible bug, or demonstrates I need to be a better programmer (undoubtedly true regardless
).
This program will run 'correctly' using
no optimizations,
optimize for size, and
optimize for size more in V10 RC2. However it will fail to run correctly when using
optimize for speed or
optimize for speed more in V10 RC2. Using V9.009 it always works with all original code as written and any optimization desired. I have stripped out many, many, lines of code to get a small example for V10.
It 'appears' that a pointer changes. A statement
memset(p_ext,0,49); // clear extension storage is clearing a different pointer space that belonging to p_LineIn.
If I change this one line to clear by writing nothing
swprintf(p_ext,49,L"%s",""); // clear extension storage then the optimizations ALL work and the program runs correctly.
There are other lines of code that can be removed and the result changes as well, but they seem unrelated to clearing p_ext. Also using wmemset has the same issue as memset. If there is a programmer pointer error I've gone blind to it.....
At the top of mainc. there are some instructions on what lines to comment out to try it. When it works correctly two message boxes will show with identical strings and the program will quit. When it fails the second message box is blank, a third box will indicate that it failed.
I will really appreciate any help, or tips, and your time to look this over, hopefully I won't be too embarrassed!
John