[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[open-cobol-list] Re: static cobol 2 c
From: |
Xavier COUDIN |
Subject: |
[open-cobol-list] Re: static cobol 2 c |
Date: |
Mon Oct 24 06:24:53 2005 |
thanks a lot for your support...it worked immediately well !!!
------------------------------------------------
On Sat, 22 Oct 2005 22:22:01 +0200
Roger While <address@hidden> wrote:
> Adding to Gary's comments -
> There are 2 more fundamental issues -
> 1) The Little/Big endian consideration
> 2) The field size
>
> In order to directly use C short/int/long long, then binary fields
> should be defined as COMP-5 (ie. Native byte order).
> Also, the field length must be correct.
> So,
> PIC S9(4) COMP-5 (signed) short
> PIC 9(4) COMP-5 unsigned short
> PIC S9(8) COMP-5 (signed) int
> PIC 9(8) COMP-5 unsigned int
> PIC S9(18) COMP-5 (signed) long long
> PIC 9(18) COMP-5 unsigned long long
>
> As Gary pointed out, if the short/int/long long field is not
> naturally aligned, then you must pack the structure; eg gcc's
> attribute packed.
>
> Roger
>
>
>
>