I'm currently on Ubuntu 12.04 running version: "cobc (OpenCOBOL) 1.0.0".
I'm starting to hit problems that I can't diagnose, like a segfault in the compiler (below). I don't expect anyone is going to support this old version, so I'm thinking of installing Gnu COBOL. However I have a couple of questions maybe someone here can answer:
1. At
sourceforge.net/projects/open-cobol/ it says "GnuCOBOL 2.0 is on rc-2 close to release". Does this mean I should wait for release, or install rc-2?
2. Is the package name still open-cobol or gnu-cobol? If the latter, will apt-get simply install new executables and libraries without checking for existing files of the same name? Should I uninstall open-cobol first?
In case anyone's interested in seeing if the segfault still exists in Gnu COBOL, here's a minimal source program that triggers it for me:
--
id division.
program-id. cobcbug.
author. Hugh Sweeney.
environment division.
input-output section.
file-control.
select listing assign to "uin"
organization is line sequential.
data division.
file section.
fd listing.
01 inrec pic x(80).
working-storage section.
77 linenumber pic 99999 value 0 comp.
77 sub1 pic 9 comp.
01 value all "X".
10 pic x.
88 looks-like-statement-start value "T" False is "F".
01 grp6.
05 sgrp6 pic x(6). *> Extra lines I inserted...
05 filler redefines sgrp6. *> ...to work around segfault.
10 num6 pic 9 occurs 6.
procedure division.
if inrec(sub1:sub1) is numeric
move inrec(sub1:sub1) to num6(sub1)
else
if inrec(sub1:sub1) = space
if grp6(1:sub1) = linenumber + 1 *> Segfault.
* if sgrp6(1:sub1) = linenumber + 1 *> Compiles ok.
set looks-like-statement-start to true
end-if
end-if
end-if
.
--
and here's what I see when I try to compile it:
>cobc -Ox cobcbug.cbl
Segmentation fault (core dumped)
>
Uncommenting the commented line in the proc div and commenting the prior line results in a clean compile. Knowing this user, the prior line is probably a user error, but the segfault is beyond my ability to fix.
Hugh
--