From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96075319106351.tru64-unix-managers.marc@archive.invalid> From: chu () musp0 ! Jpl ! Nasa ! Gov (Eugene Chu) Date: Mon, 03 Apr 1995 14:54:26 +0000 To: tru64-unix-managers Subject: Answer: Unaligned access messages X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96075319106351 Hi All, I found the answer to my original question about unaligned accesses generated by a program ported from SunOS to OSF/1. It seems that this program has had other problems in the past, where someone was generating a file with binary data contained in a structure, and the file was not being properly read by another program. This original problem was traced to how the c compiler was generating extra bytes in a structure to pad data elements to a "natural" boundary in the first program, and not properly interpreted by the second. A temporary solution was gained by using the -ZpX compiler flag, which forced out all the extra padding bytes. This help cause the second problem on the third program, which was unaligned accesses on double precission floating point numbers; they all ended up on non 8 byte boundaries. Of course, now that I think I understand the nature of byte alignments and such, I think the real solution is to fix the second program, which was not properly reading the files generated by the first program, and remove -ZpX from all of them. Thanks to Fabrice Cuq (fabrice@cisk.atmos.Ucla.EDU) for his suggestions. eyc