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: folkert
Subject: Re: [Bug-GnuCOBOL] produces uncompilable c code
Date: Sat, 1 Apr 2017 01:17:30 +0200
User-agent: NeoMutt/20170306 (1.8.0)

Hi,

That's not what all the other compilers do.
At least MF and maybe also enterprise cobol accepts it.

On Fri, Mar 31, 2017 at 11:51:37AM +0100, Edward Hart wrote:
> This bug has been fixed in r1486: SET ADDRESS OF BYTES(1) now causes an
> error like other compilers.
> 
> Edward
> 
> On 29 March 2017 at 14:12, Edward Hart <address@hidden> wrote:
> 
> > Thanks for the report, Folkert. I've added added it as bug #366
> > <https://sourceforge.net/p/open-cobol/bugs/366/> on the SourceForge bug
> > tracker and I'll look into it shortly.
> >
> > Edward
> >
> > On 29 March 2017 at 12:11, folkert <address@hidden> 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
> >>
> >> --
> >> ----------------------------------------------------------------------
> >> Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com
> >>
> >>
> >


Folkert van Heusden

-- 

Multitail - gibkaja utilita po sledovaniju log-fajlov i vyvoda
kommand. Fil'trovanie, raskrašivanie, slijanie, vizual'noe sravnenie,
i t.d.  http://www.vanheusden.com/multitail/
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com



reply via email to

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