[Info-vax] nice for VMS
Richard B. Gilbert
rgilbert88 at comcast.net
Mon Apr 13 17:27:21 EDT 2009
Arne Vajhøj wrote:
> 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).
>
I never noticed that one! I don't do much programming these days. When
I did, I learned to avoid access violations, segmentation faults, 0C0
ABENDS (IBM 360/91) etc. We had some very nice software from Waterloo
Univerity called WATFOR, and, later WATFIV. It told you exactly where
you had screwed up. I learned a lot from it about the no-no's of
programming. It gave a screamingly fast compilation and excellent
diagnostics. You didn't want to use it for any serious number crunching
however!
More information about the Info-vax
mailing list