alignment of struxures/portability

cottrell at nbs-vms.ARPA cottrell at nbs-vms.ARPA
Tue Jan 8 08:07:56 AEST 1985


/*
1) alignment
i realize that allowing unaligned struxures may bomb on some machines.
my point is: make the programmer add the alignment bytes explicitly if
this is so. i know, more work. but this then allows the programmer to
take advantage of nonalignment where permissible. i know, non-portable.
okay, then allow nonaligned struxures and let the compiler generate
shifting/masking code to realign the long int. i know, inefficient.
to robert elz: does your compiler *really* align everything (even
character data) on longword boundaries? what machine/system?
2) portability
as you have guessed by now, things are neither absolutely portable nor
absolutely nonportable. it is a spectrum. its either *kinda portable* or
*mostly portable* or *barely portable*. welcome to reality.
*/



More information about the Comp.lang.c mailing list