bug-gnucobol
[Top][All Lists]
Advanced

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

Re: [Bug-GnuCOBOL] produces uncompilable c code


From: Sergey Kashyrin
Subject: Re: [Bug-GnuCOBOL] produces uncompilable c code
Date: Wed, 29 Mar 2017 10:27:44 -0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

Hmm.

Mainframe:

ska 403> cob2 ptr2.cbl
 PP 5655-S71 IBM Enterprise COBOL for z/OS  4.2.0 in progress ...
 LineID  Message code  Message text
     11  IGYSC2025-W   "GRP" or one of its subordinates was referenced, but
                       "GRP" was a "LINKAGE SECTION" item that did not have
                       addressability.  This reference will not be resolved
                       successfully at execution.
19 IGYPS2161-S "ADDRESS OF" operand "BYTES" was found as the receiving operand of a "SET" statement, but was not a level-01 or
                       level-77 "LINKAGE SECTION" item.  The statement was
                       discarded.
Messages Total Informational Warning Error Severe Terminating
 Printed:       2                          1                   1
 End of compilation 1,  program TESTMOVE,  highest severity 12.
 Return code 12

Old Microfocus:

g:\skatests\cobol>cobol ptr2.cbl;
MERANT Micro Focus Net Express V3
Version 3.1.11 Copyright (C) 1984-2000 MERANT International Ltd.
URN AXCGG/AA0/00000
    19     SET ADDRESS OF BYTES(1) TO MEM-ADDR.
* 344-S*************************** **
**    Should be level 01 or 77
* Checking complete - errors found

Regards,
Sergey


On 3/29/2017 7:11 AM, folkert wrote:
Hi,

The following cobol code (which runs fine on e.g. microfocus and
most mainframes) causes opencobol 1.1.0 and gnucobol 2.0.0 to produce
invalid C-code:

        IDENTIFICATION DIVISION.
        PROGRAM-ID. TESTMOVE.

        ENVIRONMENT DIVISION.
        CONFIGURATION SECTION.

        DATA DIVISION.
        WORKING-STORAGE SECTION.

        LINKAGE SECTION.
        01 GRP.
           03 BYTES       PIC 9(2) COMP-5 OCCURS 2.

        77  MEM-ADDR    POINTER.

        PROCEDURE DIVISION USING
                BY VALUE MEM-ADDR.

            SET ADDRESS OF BYTES(1) TO MEM-ADDR.

            GOBACK.

        END PROGRAM TESTMOVE.

This results in:

address@hidden:~/cob$ cobc -free test3.cob
/tmp/cob3587_0.c: In function ‘TESTMOVE_’:
/tmp/cob3587_0.c:95:15: error: lvalue required as left operand of assignment
      (b_5 + 0) = (*(unsigned char **) (b_7));
                ^



Folkert van Heusden





reply via email to

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