www.digitalmars.com         C & C++   DMDScript  

c++ - Optimizer Bug - bug.cpp

reply John Jameson <John_member pathlink.com> writes:
Hi Walter

Looks like we've finally managed to break DMC 8.45 (100,000's lines of code have
been OK so far!)

Attached is bug.cpp containing:

#include <stdio.h>


int w[16];

void main (void) 
{ char buffer[1024], *ptr=buffer; 
for (int i=0; i<8; ++i) 
ptr += sprintf (ptr, "W%-2d=0x%04X ", i, w[i]); 
printf ("buffer is '%s'\n", buffer); 
} 

Compile as sc -mn bug.cpp and then again with -o+time and get different results.
We haven't looked at exactly, what the compiler is doing.

Cheers
John
Nov 01 2005
parent "Walter Bright" <newshound digitalmars.com> writes:
No prob, I'll take care of it.
Nov 01 2005