[Info-vax] nice for VMS
Arne Vajhøj
arne at vajhoej.dk
Mon Apr 13 16:39:04 EDT 2009
Richard B. Gilbert wrote:
> Michael Kraemer wrote:
>> Arne Vajhøj schrieb:
>>
>>>
>>> It happens - struct(ure)s that are written or read to or
>>> from file/socket and have to be packed.
>>>
>>> Obviously not very funny when the code later has to be ported
>>> to Solaris/SPARC.
>>
>> In this case it might be better to align the structure members
>> manually on 4/8 byte boundaries by inserting appropriate
>> padding members. Wastes space, but reduces headaches.
>
> A great deal depends on how often the structure is accessed! If once a
> day, forget it. If 10,000 times a day it's probably worth fixing.
If it is Solaris/SPARC it is a problem even once a day.
Because unaligned access crashes the program (segmentation fault).
Arne
More information about the Info-vax
mailing list