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 10:36:00 -0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

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





reply via email to

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