|
From: | Ron Norman |
Subject: | Re: [Bug-GnuCOBOL] produces uncompilable c code |
Date: | Wed, 29 Mar 2017 14:26:28 -0400 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |