12-12-2012
20,
0
Join Date: Dec 2012
Last Activity: 2 May 2013, 9:52 AM EDT
Posts: 20
Thanks Given: 1
Thanked 0 Times in 0 Posts
CC versios 5.5 to 5.8 codecompatability
Hello
Machine A:CC: Sun C++ 5.5 Patch 113817-07 2004/03/23
Machine B:CC: Sun C++ 5.8 2005/10/13
I have compiled a code with same options
/opt/SUNWspro/bin/CC -c -fast -O3 -DSYSTEMV -DCGM attdictionary.C
on both the Machines A,B
on Machine A i could see code successfully compiled
on Machine B it is not it reporting following Error
"attdictionary.C",line 226: Error: count is not defined.
i could see code some thing like this
.....
.....
function()
{
for(int count;count<10;count++)
{
...........
}
if(count<10)--->error coming here
{
}
}
ideally according to the scope rules it should report error but why it is successfully compiled on Machine A not on Machine B
is this due to compiler versions??
Any solution to the problem is helpful and appreciable.Thanks in advance.
Thanks
Revathi R