GnuCOBOL 3.2 includes many new features compared to the previous release, while maintaining full source compatibility.
The amount of changes from GnuCOBOL 3.1 to 3.2 is huge, here are some of the highlights:
For a much more complete list, have a look at the NEWS file.
(note: runtime support needs additional library libxml2)
(note: runtime support needs additional library cJSON or JSON-C)
of seconds in C$SLEEP now
and RM/COBOL variants
to be turned on/off per source as desired
Fujitsu, MicroFocus COBOL, Microsoft COBOL, RM/COBOL, CA Realia and more)
by several compilers including Micro Focus
This allows users to insert an external file handler while retaining
all of the normal COBOL I/O functions with a possible callback to libcob.
To have the compiled program call `yourfh()` for file I/O use:
`cobc -fcallfh=yourfh`
In turn `yourfh()` may call `EXTFH()` to use I/O functions from GnuCOBOL.
The external file handler can also be directly invoked from COBOL, too,
using `CALL "EXTFH"`.
Note: Not each flag contained in the FCD3 is handled already
entries starting with a period or number are not resolved any more,
periods in the external identifier are always replaced by underscore
-> MY.FILE is resolved by DD_MY_FILE, dd_MY_FILE, MIFILE now;
prefixes "-F " and "-D " are removed from external names;
if filename is not absolute after translation, COB_FILE_PATH is now
still applied;
File name mapping now applies both to COBOL statements and CALLable
CBL_ and C$ file routines.
use of CURSOR clause in SPECIAL-NAMES for positioning on ACCEPT
runtime configuration option COB_STRACK_TRACE
was heavily improved and combines consecutive identical OCCURS items,
leading to smaller dump files
* copybook names that contain an extension aren't searched with additional
extensions [as post-rc1-change this may be set to old behaviour by
defining COB_MULTI_EXTENSION when building GnuCOBOL/cobc]
* library names are now tested for environment "COB_COPY_LIB_libname",
allowing the directory to specified externally (also as no-directory
by exporting with empty value) and has a fallback (with a warning) to
be effectively ignored (as previous versions did this)
"LINE / COL signed-integer" (inadvertently available since 2.2/3.0rc1);
which will now raise an error "unsigned integer expected";
if used replace by standard "LINE / COL +/- integer"
(will be removed in the next version if no explicit user requests are raised)
-f[no]-ec=exception-name to tune the exception checks similar to the >>TURN
directive, you may also leave out the "EC-" prefix here, example to
enable all checks but disable all bound checks but OCCURS DEPENDING ON:
cobc -debug -fno-ec=bound -fec=bound-odo
-Wextra "new" option to enable every possible warning that is not dialect
specific (this option used to be called -W)
-Wadditional new warning group for all warnings that don't have a group
on their own
-Wno-error and -Wno-error=<warning> to treat (specific <warning>s) not as error
-Wdangling-text for raising the warning "source text after program area",
not included in -Wall any more
-Wno-ignored-error allows to suppress messages that normally would be an
error and are only allowed because they are never executed
-Wcorresponding is now enabled by default
-f[no]-diagnostics-show-option, enabled by default, shows the
command line option responsible for the diagnostic message
extra information to a warning (or error) is now marked as "note:"
now and includes the total amount of direct references
ascending order now
debugging options available on the system
all ENTRY and SECTION elements to ease source level debugging
To prevent this disable translations in general with using the configure
option --disable-nls (or by deactivating ENABLE_NLS in config.h).
against libcob and need cob_decimal include gmp.h/mpir.h yourself before;
otherwise you do not need it in your include path any more
were added, see new C-API documentation
(by CBL_ERROR_PROC) were ignored. This was changed according to the
documentation for CBL_ERROR_PROC -> a RETURN-VALUE of ZERO skips further
error handlers to be called, including the internal one.
unexpected result.
may now be build and/or tested and/or the test results checked separately.
You now may also run the tests with a previous installed version of GnuCOBOL
(or a version specified by a manual temporary setup).
For details see tests/cobol85/README.
library is to be used, where ARG may be: check (default), gmp, mpir
XML runtime support, otherwise it will be included if found as working
JSON runtime support, otherwise it will be included if found as working
Note: As a special case you may built-in cJSON by placing its source in
the folder "libcob". If it is included there, this version will be compiled
into libcob. It may be enforced with --with-json=local,
like --with-json=cjson and --with-json=json-c enforce the given library.
GMP_CFLAGS / MPIR_CFLAGS and GMP_LIBS / MPIR_LIBS.
If unset configure will try pkg-config.
and XML2_LIBS. If unset configure will use pkg-config / xml2-config.
and CJSON_LIBS, similar JSON_C_CFLAGS and JSON_C_LIBS for libjson-c.
If unset configure will use pkg-config.
hardening options or leave as-is, or disable (which previous versions
effectively did)
provided defines are now found in the single header config.h
uninstalled binaries. Samples:
pre-inst-env cobc -xj prog.cob
pre-inst-env cobcrun -M prog start
pre-inst-env may also be called without parameters to start a new shell
session with the environment adjusted to use the uninstalled version.
includes the following CVEs:
compiler (may be triggered with special crafted source files)
CVE-2019-14468, CVE-2019-14486, CVE-2019-14528, CVE-2019-14541,
CVE-2019-16396, CVE-2019-16395
if set to any value the option parsing in cobc, cobcrun and CBL_GC_GETOPT
stops at the first nonoption, otherwise it stays with the old behaviour and
re-orders nonoptions to the end)
* if built with vbisam, cisam or disam, depending on the version used, some
tests will lead to UNEXPECTED PASS, while others may fail
* possibly failing tests (false positives):
* temporary path invalid
* compiler outputs (assembler)
* compile from stdin
* NIST: OBNC1M.CBL false positive (the test runner uses a nonportable way of
emulating a program kill)
as expected in all cases
(especially when using a different compiler than GCC)
* function with variable-length RETURNING item
* USAGE POINTER, which may need to be manually aligned
While this version is a release-candidate (with an expected full release within 3 months) it is the most stable and complete free COBOL compiler ever available.
Source kits can be found at https://alpha.gnu.org/gnu/gnucobol, the first pre-built binaries are already available and the OS package managers are invited to update their packages.
Compared to the last stable release of 2.2 we have such a huge change list that it is too much to note here for the release candidate; but it will be done with the final release and even there the NEWS entry which you can check now at https://sourceforge.net/p/gnucobol/code/HEAD/tree/tags/gnucobol-3.1-rc1/NEWS is very compacted.
The RC1 got extensive tests over the lasts months and is downward compatible to GnuCOBOL 2.2 - you are invited to upgrade GnuCOBOL now or start your own tests with the release candidate to be able to update when the final release arrives.
Dear GnuCOBOL users,
after almost 7 years of continual improvement and refinements since
OpenCOBOL version 1.1 and 3 years after the release of GnuCOBOL 1.1,
the GnuCOBOL team is proud to announce the formal release of
GnuCOBOL 2.2.
We now reached a substantial coverage of COBOL 85, 2002, 2014 standard
and X/Open COBOL, supporting many extensions from IBM COBOL, MicroFocus
COBOL, ACUCOBOL-GT and others.
As always - more information can be found at:
https://www.gnu.org/software/gnucobol/
Official source kits can be downloaded from:
https://ftp.gnu.org/gnucobol/
Here's a list of the highlights of this release, especially for people
that still use one of the last releases (OpenCOBOL 1.1 which is still
included in many package managers or GnuCOBOL 1.1):
> * New GnuCOBOL features (too much to list)
>
> ** User Defined Functions, FUNCTION-ID.
>
> ** New intrinsic functions
>
> ABSOLUTE-VALUE alias for ABS
> CURRENCY-SYMBOL CURRENCY-SYMBOL of the current program
> FORMATTED-CURRENT-DATE ISO 8601 datetime function
> FORMATTED-DATE ISO 8601 datetime function
> FORMATTED-DATETIME ISO 8601 datetime function
> FORMATTED-TIME ISO 8601 datetime function
> TEST-FORMATTED-DATETIME ISO 8601 datetime function
> INTEGER-OF-FORMATTED-DATE date to integer
> HIGHEST-ALGEBRAIC now implemented
> LOWEST-ALGEBRAIC now implemented
> LOCALE-COMPARE now implemented
> NUMVAL-F now implemented
> TEST-NUMVAL now implemented
> TEST-NUMVAL-C now implemented
> TEST-NUMVAL-F now implemented
> LENGTH-AN alias for BYTE-LENGTH
> MODULE-CALLER-ID return the name of the caller
> MODULE-DATE current module: compilation date
> MODULE-TIME current module: compilation time
> MODULE-FORMATTED-DATE current module: formatted datetime
> MODULE-ID current module: PROGRAM-ID
> MODULE-PATH current module: path on compile time
> MODULE-SOURCE current module: name on compile time
> MONETARY-DECIMAL-POINT LOCALE based fiscal decimal point
> MONETARY-THOUSANDS-SEPARATOR LOCALE based fiscal visual grouping
> separator
>
> Note:
> The functions that are actually available as intrinsic functions depend
> on the -std used. Function names that aren't marked as intrinsic functions
> by the current -std can be used freely as user defined words or
> even as user defined functions.
>
> ** New system functions
>
> C$CALLEDBY return the name of the caller
> CBL_GC_FORK fork current process (not on Windows)
> CBL_GC_WAITPID wait for process to end
> CBL_GC_GETOPT (CBL_OC_GETOPT) comand lineoption parser for COBOL
> CBL_GC_PRINTABLE (C$PRINTABLE) check if character is printable
> CBL_GC_HOSTED (CBL_OC_HOSTED) provides access to C extern variables,
> like stdin, errno
> CBL_GC_NANOSLEEP CBL_OC_NANOSLEEP
> CBL_GET_SCR_SIZE get current terminal size - if any
> CBL_READ_KBD_CHAR get character from terminal
> CBL_SET_CSR_POS set current position on terminal
> x'E4' clear terminal screen
> x'E5' ring the bell
>
> ** many new / extended COBOL statements from COBOL2002/2014 and extensions
> from different COBOL dialects
>
> ** more SWITCHes: from SWITCH-01 to SWITCH-36 and its variants from many
> COBOL dialects
>
> ** more IEEE numeric types added, FLOAT-DECIMAL-16, FLOAT-DECIMAL-34, etc
>
> ** more literal types added, numeric boolean etc.
>
> ** most of the COBOL 2014 spec Compiler Directive Facility is in
>
> ** optional: stricter syntax checks
>
> ** refactored and extended compiler and runtime messages with available
> translations (currently to Spanish, Portuguese and Dutch, partial to
> German)
>
> ** screen IO: many extended ACCEPT DISPLAY and SCREEN SECTION changes
>
> ** Direct call interface for C:
> CALL-CONVENTIONS for CALLs and PROCEDURE DIVISION
> SIZE of parameters specified for CALL ... BY VALUE
> RETURN NOTHING for calling void functions
> RETURN ADDRESS OF VAR for calling functions returning a pointer
> PROCEDURE DIVISION RETURNING OMITTED -> callable as void function
>
> ** Much, much more!
>
>
> * New cobc options:
>
> ** New -std options:
>
> cobol2014 COBOL 2014 Standard
> xopen X/Open COBOL Standard
> mf-strict Micro Focus COBOL compatibility - strict
> ibm-strict IBM COBOL compatibility - strict
> ibm-strict MVS/VM COBOL compatibility - strict
> acu ACUCOBOL-GT compatibility
> acu-strict ACUCOBOL-GT compatibility - strict
> bs2000 BS2000 COBOL compatibility (back again)
> bs2000-strict BS2000 COBOL compatibility - strict
> rm RM-COBOL compatibility
> rm-strict RM-COBOL compatibility - strict
>
> Note:
> The GnuCOBOL compiler tries to limit both the feature-set and reserved words
> to the specified compiler when the "strict" dialects are used.
> COBOL sources compiled with these dialects are therefore likely to compile
> with the specified compiler and vice versa: sources that were compiled on
> the specified compiler should compile without any issues with GnuCOBOL.
>
> With the "non-strict" dialects GnuCOBOL will activate the complete
> feature-set where it doesn't directly conflict with the specified dialect,
> including reserved words and GnuCOBOL specific extensions.
> COBOL sources compiled with these dialects therefore may work only
> with GnuCOBOL. COBOL sources may need a change because of rich feature-set
> and reserved words in GnuCOBOL, otherwise offending words may be removed
> by `-fno-reserved=word`.
> COBOL-85, X/Open COBOL, COBOL 2002 and COBOL 2014 are always "strict".
>
> ** New listing options:
>
> -t listing, -T wide listing, --tlines=lines, lines per page of listing
> -Xref
>
> Note: -P, generate preprocessor listing, is still available (and improved)
>
> ** All compiler configuration flags may be set on command line
> to override a specific setting of the current -std, see cobc --help
>
> ** All Warnings can be explicit enabled/disabled or even marked as error,
> see cobc --help
> -Wunreachable report on possible unreachable statements
>
> ** Options for the C compiler/linker:
> -K <entry>, compile entry point as static (resolve at link time)
> -A, add options to C compile phase
> -Q, add options to C link phase
>
> ** Miscellaneous
> -i -info, display build/environment
> -D define symbol for Compiler Directive Facility
> -j -job=args, run job after compile
> input filename of '-' reads source from standard in
> For more: see cobc --help
>
>
> * New cobcrun options:
>
> -i -info, display build/environment
> -r -runtime-env, display runtime configuration
> -c -config, set runtime config from file
> -M -module, set path/module name when looking for entry
>
>
> * New build features
>
> make test downloads NIST testsuite if necessary
> now usable with parallel builds (make -j4 test)
> make checkall runs both the internal an NIST testsuite
>
> ** testsuite defaults to coloured output
>
> ** Windows(tm) Visual Studio build support files added,
> options to validate the software generated with VS against both test suites
>
> ** removed maintainer mode - if files need a rebuild because of a change
> they are always rebuild
>
> ** help2man, bison and flex are checked during configure,
> if they need to be invoked and are missing a useful error message is given
>
> ** All files created by GnuCOBOL runtime use the same file permission settings
> now: COB_FILE_MODE which was changed to 0666
>
> ** changed unix package name from "gnu-cobol" to "gnucobol"
While many people have contributed special thanks go to Ron Norman, Edward Hart, Brian Tiffin, Dave Pitts, and Sergey Kashyrin and to everyone reporting issues and making suggestions.
Happy coding,
Simon
A release candidate of GnuCOBOL 2.2 has been posted to alpha.gnu.org for trials.
ftp://alpha.gnu.org/gnu/gnucobol/
gnucobol-2.2-rc.tar.gz
.xz archive also available. One other source kit more suitable for a commonly used operating system was also posted as gnucobol-2.2-rc_win.zip
GnuCOBOL has been in active development for some 16 years now, as OpenCOBOL (then as a short stint as GNU Cobol when the project was first dubbed into the GNU fold, eventually settling on the GnuCOBOL spelling). GnuCOBOL version 2 is finally on the cusp and ready for testing.
For Help Getting Started, visit
https://sourceforge.net/p/open-cobol/discussion/help/
Have good, make well.
After a long development cycle as OpenCOBOL, and recent acceptance as a GNU free software project, with a renaming to GNU Cobol, a release is out. The first ftp source kits are now signed and posted to
ftp://ftp.gnu.org/gnu/gnucobol
This is free COBOL. No fees. Free. In and of itself, not as important as the feature coverage of this COBOL compiler. Many thanks to Keisuke Nishida and Roger While, and many others.
We hang out on SourceForge, at http://sourceforge.net/p/open-cobol/discussion/
Enjoy.