05-22-2017 03:53 AM
I am using the Intel Compiler C++ 16.0 from Parallel Studio XE Composer Edition. It is integrated inside MS Visual Studio Professional 2013. The OS is Windows 8. I usually prefer such compiler, in place of the native MS C/C++ compiler. But recently I had a problem in writing a binary file with "big endianess" of the data. Such byte ordering in the file is requested by the program which visualizes the data stored in the file itself (even if it is used on a "little endian" machine). I wrote code using a "union" C type to invert the bytes ordering before writing on the disk. However, by compiling with the Intel compiler I was not able to get the right data formatting, which instead I got by using the MS native compiler. Could someone explain me why? Thanks.
Valued Contributor II
05-23-2017 01:14 PM
>>...However, by compiling with the Intel compiler I was not able to get the right data formatting, >>which instead I got by using the MS native compiler. Could someone explain me why?.. You need to create a small reproducer of the problem because a description of your problem is too generic. I have an extensive experience with data sets serialization and when codes are implemented in a portable way then stored data sets are absolutely identical ( using many C++ compilers ). I could only suspect that your codes are Not portable and different versions of some pieces of codes were used for Intel and Microsoft compilers.