struct 32 bit aligned and padded

Chris Bertin chrisb at risky.Convergent.COM
Fri Apr 19 04:44:03 AEST 1991


In article <14082 at arctic.nprdc.navy.mil> stanonik at nprdc.navy.mil (Ron Stanonik) writes:
...
alignment problem description deleted
...
>                  ... From K&R second edition, I gather there are no
>assurances regarding alignment or padding in this instance, but this
>behaviour seems contrary to the usefulness of C as a low level language.
>

If C had per-structure alignment directives, it would make it a lot more
useful as a low level language, but it would also make it a lot less portable.
Some compilers use environment variables (STALIGN, DBLALIGN in Motorola
compilers) to align structures. Perhaps the 3B2 has something of the sort.
This could help you in this case, although these variables may cause major
other problems if you end up with standard (/usr/include/...) structures
aligned differently between your .o files and the libraries.

-- 
Chris Bertin		|   chrisb at risky.Convergent.COM
Unisys			|		or
(408) 435-3762		| ...!uunet!pyramid!ctnews!risky!chrisb



More information about the Comp.unix.programmer mailing list