HOME  NEWS  FORUM  DOWNLOAD  LINK
OpenCOBOL - an open-source COBOL compiler
Main Menu
Download
Documentation
Development
Who's Online
26 user(s) are online (5 user(s) are browsing Forum)

Members: 0
Guests: 26

more...
Powered by
SourceForge

Xoops

Creative Commons

OpenCOBOL Forum Index
   OpenCOBOL
     Strange compiler behaviour
Register To Post

Threaded | Oldest First Previous Topic | Next Topic | Bottom
Poster Thread
the_piper
Posted on: 2012/4/8 1:34
Just popping in
Joined: 2009/9/18
From:
Posts: 17
Re: Strange compiler behaviour
Thanks, Brian, for your fast reply.

As a workaround, my preprocessor will now comment out such lines, AUTHOR, DATE-WRITTEN (insert an asterik in column 7).

But, yeah, it would be really nice to release a version of OpenCOBOL, where this strange behaviour is fixed.
btiffin
Posted on: 2012/4/8 0:13
Home away from home
Joined: 2008/6/7
From: CANADA
Posts: 1196
Re: Strange compiler behaviour
the_piper;

First sample works with 1.1 Feb2009.

I'm really going to pester Roger to tag 1.1 Feb2009 as RELEASE and get it into the main distribution channels.

August board members: do you all agree that 1.1 is street ready and an upgrade from the 1.0 sources?

It should start making the packaging rounds in my humble. As far as I know, all that needs to start the ball rolling is an update of the source codes on sourceforge? http://sourceforge.net/projects/open-cobol/

Cheers,
Brian
the_piper
Posted on: 2012/4/7 22:42
Just popping in
Joined: 2009/9/18
From:
Posts: 17
Strange compiler behaviour
By narrowing down a problem with generated code, i stumbled about this effect:

Program 1 is not working, compiled with cobc -x. Compiled with cobc -C you can see in the C-program, that the procedure division is empty.
----+-*--1----+----2----+----3----+----4----+----5----+----6----+----7-*--+----8
      **************************************************************************
      *  I D E N T I F I C A T I O N   D I V I S I O N                         *
      **************************************************************************
        IDENTIFICATION  DIVISION.
        PROGRAM-ID.     DBTEST.
        AUTHOR.         PIPER.
        DATE-WRITTEN.   TODAY.
      /
      **************************************************************************
      *  D A T A    D I V I S I O N                                            *
      **************************************************************************
        DATA            DIVISION.
      /
      **************************************************************************
      *  W O R K I N G   S T O R A G E   S E C T I O N                         *
      **************************************************************************
        WORKING-STORAGE SECTIOn.
      /
      **************************************************************************
      *  P R O C E D U R E   D I V I S I O N                                   *
      **************************************************************************
        PROCEDURE DIVISION.
            DISPLAY 'In dbtest'
				STOP RUN.

This program does nothing, when you run it. The text is not displayed, nor is a error message given when compiling it with cobc -x dbtest.cob

But THIS program does what it should do, display the text.

----+-*--1----+----2----+----3----+----4----+----5----+----6----+----7-*--+----8
      **************************************************************************
      *  I D E N T I F I C A T I O N   D I V I S I O N                         *
      **************************************************************************
        IDENTIFICATION  DIVISION.
        PROGRAM-ID.     DBTEST.
      /
      **************************************************************************
      *  D A T A    D I V I S I O N                                            *
      **************************************************************************
        DATA            DIVISION.
      /
      **************************************************************************
      *  W O R K I N G   S T O R A G E   S E C T I O N                         *
      **************************************************************************
        WORKING-STORAGE SECTIOn.
      /
      **************************************************************************
      *  P R O C E D U R E   D I V I S I O N                                   *
      **************************************************************************
        PROCEDURE DIVISION.
            DISPLAY 'In dbtest'
				STOP RUN.


The only difference is, the first program has an AUTHOR and DATE-WRITTEN, the 2nd not.

Try it yourself and see :D

I am using
cobc (OpenCOBOL) 1.0.0
Copyright (C) 2001-2007 Keisuke Nishida
Copyright (C) 2007 Roger While

running it under UBUNTU 10.04

Threaded | Oldest First Previous Topic | Next Topic | Top

Register To Post
 
Copyright (C) 2005 The OpenCOBOL Project. All rights reserved.
Powered by Xoops2 | PHP | MySQL | Apache
ocean-net