This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Is it a bug of gcc


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]