bug-gnucobol
[Top][All Lists]
Advanced

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

Re: [Bug-GnuCOBOL] segfault


From: Sergey Kashyrin
Subject: Re: [Bug-GnuCOBOL] segfault
Date: Wed, 29 Mar 2017 22:37:19 -0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1

Hi Ron,

I am not sure if it should be corrected, as if you are calling non-COBOL programs, let say C/C++, it would expect "native" integer in this case.
Anyway, I see this issue as a "non-critical", and yes, I would agree if that will come to some settings of "conf". Probably it will be the best resolution.

Cheers,
SK

On 3/29/2017 2:22 PM, Ron Norman wrote:
Actually, I corrected this in the reportwriter branch so that numeric literals passed as CALL parameters do get pass in COMP-4 format. This was corrected some time ago but has not yet been merged into the main branch.
The example program does work correctly with GnuCOBOL reportwriter branch.

On Wed, Mar 29, 2017 at 10:36 AM, Sergey Kashyrin <address@hidden> wrote:
Hi Folkert,

I think this test is incorrect, as it is up to compiler how to pass the constants (as a COMP-4 or "native integer", i.e. COMP-5)
Microfocus sends as COMP-4 to be closer to mainframe, which is BIG-ENDIAN, and of course this test will be okay on any BIG-ENDIAN platform.
Gnu is passing native integer.

Regards,
SK


On 3/29/2017 9:38 AM, folkert wrote:
Hi,

I have the following two sources. When run, it runs fine under micro
focus but segfaults under opencobol 1.1.0.
I'm not 100% sure this is valid cobol code, only a beginner :-)

test3.cob
---------
        IDENTIFICATION DIVISION.
        PROGRAM-ID. TESTD.

        ENVIRONMENT DIVISION.
        CONFIGURATION SECTION.

        DATA DIVISION.
        WORKING-STORAGE SECTION.

        PROCEDURE DIVISION.
        MAIN.
            CALL 'SOMEFUNC' USING 5, 'TESTD'
            GOBACK.
        END PROGRAM TESTD.


SOMEFUNC.cbl
------------
        IDENTIFICATION DIVISION.
        PROGRAM-ID. SOMEFUNC.

        ENVIRONMENT DIVISION.

        DATA DIVISION.
        WORKING-STORAGE SECTION.

        LINKAGE SECTION.
        01 ARG-LEN      PIC S9(09) COMP.
        01 PGM-NAME     PIC X(20).

        PROCEDURE DIVISION USING ARG-LEN, PGM-NAME.
            DISPLAY '==> Starting ', PGM-NAME(1:ARG-LEN)
            GOBACK.

        END PROGRAM SOMEFUNC.



Folkert van Heusden






--
Cheers
Ron Norman


reply via email to

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