On Wed, Oct 28, 2009 at 4:19 AM, narendra babu <[email protected]> wrote: > i would like to know what are issues need to be addressed when moving from > big endian to little endian .
If you are reading/writing binary data (int, floats, structs), then you need to ensure the appropriate byte swapping functions are used. libc has several functions for this purpose, as well as several 3rd party libraries are also available. Other than this, I don't think there are any endian issues to be worried about. > 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 . Shift operators work as expected on both platforms. Nothing to worry. Ensure byte swapping is done immediately after read(), and just before write() and there should be no problems. You should consider the different sizes of int and long on 64bit and 32bit platforms. Sparc enforces stricter memory alignment than x86, so the size of structs will vary between platforms. Never make assumptions, and always use sizeof() to calculate memory requirements for structs and arrays. - Raja _______________________________________________ To unsubscribe, email [email protected] with "unsubscribe <password> <address>" in the subject or body of the message. http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
