bug-gnucobol
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-GnuCOBOL] Binary allocations - -fbinary-size=2-4-8


From: Ron Norman
Subject: Re: [Bug-GnuCOBOL] Binary allocations - -fbinary-size=2-4-8
Date: Tue, 15 May 2018 14:29:21 -0400

A PIC 99 COMP-5 does already end up as CB_USAGE_COMP_5, not an CB_USAGE_xxSIGNED_CHAR.
I think that compute_binary_size needs a fix.

This was my fix...

1357c1357,1359
<               if (f->flag_real_binary && size <= 2) {
---
>               if (f->flag_real_binary
>                && cb_mf_ibm_comp != 1
>                && size <= 2) {             



On Mon, May 14, 2018 at 6:38 PM, Sergey Kashyrin <address@hidden> wrote:

Hi Folks,

As a fastfix

In field.c in
validate_field_1
...
/* Validate USAGE */
for those:
        case CB_USAGE_SIGNED_CHAR:
        case CB_USAGE_UNSIGNED_CHAR:
instead of:
        f->usage = CB_USAGE_COMP_5;
do:
        f->usage = CB_USAGE_BINARY;
(we don't care about byteorder - it is 1 byte)

and then in compute_binary_size change
        if(f->flag_real_binary && size <= 2) {
to
        if(f->flag_real_binary && size <= 2 && f->usage != CB_USAGE_COMP_5) {


I think it should work, even looks not nice :-)

Regards,
Sergey


On 5/14/2018 12:49 PM, Simon Sobisch wrote:
I haven't checked IBMs docs on this but I assume the correct thing to do for std ibm and bs2000 would be to implement COMP-5 as different comp type. What does MicroFocus do in ibm mode?

Simon





--
Cheers
Ron Norman

reply via email to

[Prev in Thread] Current Thread [Next in Thread]