On Wed, Oct 28, 2009 at 4:19 AM, narendra babu <cnarendra_b...@yahoo.com> wrote: > > Hello , > > I have c/C++ code in Solaris/AIX/HP-UX which is for big endian arch .
Okay. > Now i am moving the c/C++ code to Little endian Linux X86 , Okay. > i would like to know what are issues need to be addressed when moving from > big endian to little endian . There are a few. Surely left shift and right shift are good examples. There are many others too. The way ntohs() , ntohs(), ntohl(), ntohl() works will be different. Network byte order is big endian. Intel is Little Endian. So you have to work around all that. Also socket communications between a little endian and big endian machine will land you in trouble if you don't take care. It is best to convert both sides to network byte order before communication. Also ensure that you use character buffers and not integers as much as possible. Endianness only affects integers(shorts, signed, unsigned longs) As long as you use byte arrays, you won't have issues. > also is left shift and right shit oprs in C/C++ has issues when moving from > big endian to little endian or will it simply run in both archs as is without > any issues . Best of luck! -Girish -- Gayatri Hitech web: http://gayatri-hitech.com SpamCheetah Spam filter: http://spam-cheetah.com _______________________________________________ To unsubscribe, email ilugc-requ...@ae.iitm.ac.in with "unsubscribe <password> <address>" in the subject or body of the message. http://www.ae.iitm.ac.in/mailman/listinfo/ilugc