Wow!
Lev Assinovsky
LAssinovsky@algorithm.aelita.com
Sat Sep 6 11:40:00 GMT 2003
Hello all!
How about that:
-------------- cut here ------------------------------------------------
#include <iostream>
using namespace std;
int f1()
{
return 1;
}
int f2(const int n)
{
cout << n << endl;
return 2;
}
int main()
{
int k=0;
if ((k = f1() == -1) || (f2(k) == -1))
{
cout << "Shouldn't be here" << endl;
}
}
---------------- cut here ----------------------------------------
What will be printed from f2 with gcc 3.2, gcc 3.3.1?
0!!!!!!!
It is a bug. Isn't it?
----
Lev Assinovsky
Aelita Software Corporation
O&S Core Division, Programmer
ICQ# 165072909
More information about the Gcc-bugs
mailing list