Aligned access to c structures (how to avoid)

Andreas Baess andreas at easix.gun.de
Tue Feb 26 05:12:43 AEST 1991


bengsig at dk.oracle.com (Bjorn Engsig) writes:

>|If you REALLY want to bash IBM a little bit, get their COBOL (shudder shudder)
>| [ example ]
>|and try to share it with the equivalent C global structure. You will find that
>|the COBOL compiler does NOT boundary align, and you get nice weird results.

>This behaviour is not specific to IBM but to Micro Focus cobol, which
>is what is behind the IBM VS Cobol.  I'm on thin ice here, but I actually think
>cobol is required to behave like that (because of data file portability); please
>correct me if I'm wrong.

This is common in all COBOL implementations I know. There once upon was a time
where main storage was so incredible expensive. Every COBOL programmer knows,
that alignment of data can be enforced be declaring the field with an 01 level
or by adding an sync behind the declaration.

-- 
-> andreas at easix.GUN.de  {tmpmbx,mcshh,smurf,flyer}!easix
-> Was man nicht begreift kann man wenigstens nicht vergessen!



More information about the Comp.unix.aix mailing list