This is the mail archive of the gcc@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]

That foo() stuff.


I just ran the same code on both a Solaris box and my i586 machine. 

Both produces different results - UH OH!!! 

Code:
 #include <iostream>

int foo(void)
{
  cout << "2";
   return 3;
 }

 int main(void)
 {
   cout << "1" << foo() << "4" << endl;
   return 0;
 }

i586:
2134

SunOS 5.5.1 (Solaris 2?)
1234

Both used the same egcs 1.1b compiler (built by myself on both platforms,
I might add and using binutils (same version)

Cheers,
Alex.

---
 /\_/\  Legalise cannabis now! 
( o.o ) Grow some cannabis today! 
 > ^ <  Peace, Love, Unity and Respect to all.

Check out http://www.tahallah.demon.co.uk
Linux lo-pc3035a 2.1.130 #10 Mon Nov 30 10:49:50 EST 1998
One Intel Pentium 166MHz processor, 66.36 total bogomips, 16M RAM
System library 5.4.44


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