Porting issue in Solaris.
I've a code which is compiled in a solaris 32 bit system and compiled with the option CCGNUFLAGS=-xarch=v8 -xcache=16/32/1:1024/64/1 -xchip=ultra +d -instances=static ( which i guess means , it'll run as a 32 bit application ) .. These object files are unzipped and linked on a sun OS 5.8 which supports 64 bit applications too..
I've zeroed in on a probable portion of the code thats causing the problem .
The code part is ....
register long offset ; ( Offset takes 66076 in a test case );
register long diff ; ( Diff takes 33967 in that test case );
month = int((offset >> 8) & 0xFF);
day = int(offset & 0xFF);
In a 32 bit linux system, this is producing month = 2 and Day = 28 ..
In a 64 bit Solaris system, too, this is giving identical results..
However, when the application is built on the 32 bit solaris system and ran on the 64 bit system, both month and day are coming up as zero ....
I dont have direct access to test this code segment in a 32 bit machine..
Is there a glitch in the code over this porting compatibilities ? Does casting and bitmasks cause a problem ? I examined the little endian/big endian concerns.. Seems bitmasks can cause a problem..But , why it is not happening on a 64 bit solaris platform ?
Please reply ..
Thanks,
Ajith

