Is it a bug of gcc

dong jin zdjchina@hotmail.com
Sat Jan 3 06:39:00 GMT 2004


Dear Sir:
  Happy new to you.
  when  I used gcc to compile my a very small program, which had been put a 
bug by me for a test.
when I finished compiling, and run it, It run well without any problem. but 
in fact it has very clear logical error. why? I really  appreciate your 
sharing this information.
I hope to get message "Segmentation fault", but nothing happened.
the follow is the little program.
********************************
#include <stdio.h>
int foo(int n){
     return 3*n;
}
int main (void){
    int i, *p;
    int tmp[5];  /*contain five int*/
    p= tmp;
     for (i = 0; i<10; i++){
        *p++ = foo(i);
    }
    return 0;
}

the CPU is: Pentium III, the version of gcc is GCC-3.3.2

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus



More information about the Gcc-bugs mailing list