bug-gnucobol
[Top][All Lists]
Advanced

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

Re: [Bug-GnuCOBOL] segfault


From: Ron Norman
Subject: Re: [Bug-GnuCOBOL] segfault
Date: Wed, 29 Mar 2017 14:22:49 -0400

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]