bug-gnucobol
[Top][All Lists]
Advanced

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

[Bug-GnuCOBOL] produces uncompilable c code


From: folkert
Subject: [Bug-GnuCOBOL] produces uncompilable c code
Date: Wed, 29 Mar 2017 13:11:04 +0200
User-agent: NeoMutt/20170306 (1.8.0)

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

-- 
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com



reply via email to

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