Skip to content

Commit

Permalink
Merge branch 'gnucobol-3.x' into gcos4gnucobol-3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
lefessan committed Jan 19, 2023
2 parents 91b7781 + 1cf5ca5 commit 516b813
Show file tree
Hide file tree
Showing 95 changed files with 4,845 additions and 2,451 deletions.
23 changes: 20 additions & 3 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@

2023-01-16 Simon Sobisch <[email protected]>

* configure.ac: adjusted hack for AIX 64bit OBJECT_MODE

2023-01-14 Simon Sobisch <[email protected]>

* configure.ac: fix to use pdcurses when libcurses was verified

2023-01-05 Simon Sobisch <[email protected]>

* Makefile.am (CODE_COVERAGE_IGNORE_PATTERN): add some .def files
that have shown to be not useful for code coverage

2022-12-12 Simon Sobisch <[email protected]>

* configure.ac: check for and substitute PERL/perl
Expand Down Expand Up @@ -130,6 +143,7 @@
about potentially undefined macros;
* configure.ac: copyright notice in generated script
* m4/libtool.m4: updated from libtool, with additions for netbsd from Debian
(Debian 993872) and Johan Anderholm (patch #39)

2021-10-11 Simon Sobisch <[email protected]>

Expand Down Expand Up @@ -1312,8 +1326,7 @@
2003-04-19 Keisuke Nishida <[email protected]>

* cob.pc.in: Removed.

* cobpp: Removed.
* cobpp: integrated into cobc (ChangeLog entries moved there)

2002-03-01 Keisuke Nishida <[email protected]>

Expand Down Expand Up @@ -1469,6 +1482,10 @@

* configure.ac, Makefile.am: Rename 'COB_LDADD' to 'COB_LIBS'

2002-05-23 Keisuke Nishida <[email protected]>

* configure.ac.c: additions for use of gettext

2002-05-19 Keisuke Nishida <[email protected]>

* Version 0.9.5 released.
Expand All @@ -1494,7 +1511,7 @@
* Version 0.9 released.


Copyright 2002-2022 Free Software Foundation, Inc.
Copyright 2002-2023 Free Software Foundation, Inc.

Copying and distribution of this file, with or without modification, are
permitted provided the copyright notice and this notice are preserved.
7 changes: 5 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Makefile gnucobol
#
# Copyright (C) 2003-2012, 2014-2020, 2022 Free Software Foundation, Inc.
# Copyright (C) 2003-2012, 2014-2020, 2023 Free Software Foundation, Inc.
# Written by Keisuke Nishida, Roger While, Simon Sobisch
#
# This file is part of GnuCOBOL.
Expand Down Expand Up @@ -41,7 +41,10 @@ clean-local: code-coverage-clean
dist-clean-local: code-coverage-dist-clean

CODE_COVERAGE_BRANCH_COVERAGE=1
CODE_COVERAGE_IGNORE_PATTERN="*/cobc/pplex.c" "*/cobc/ppparse.c" "*/cobc/scanner.c" "*/cobc/parser.c"
CODE_COVERAGE_IGNORE_PATTERN= \
"*/cobc/pplex.c" "*/cobc/ppparse.c" "*/cobc/scanner.c" "*/cobc/parser.c" \
"*/cobc/config.def" "*/cobc/warning.def" \
"*/libcob/statement.def"

# files shipped with the package that should be 755'ed:
FILES_TO_BE_EXECUTABLE = $(dist_noinst_SCRIPTS) \
Expand Down
96 changes: 68 additions & 28 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
NEWS - user visible changes -*- outline -*-

GnuCOBOL 3.2rc1 to be released asap,
3.2 final (depending on feedback) end of 2022
3.2 final (depending on feedback) January 2023

planned:
* configure: minor checking to set TIME_T_IS_NON_ARITHMETIC
Expand Down Expand Up @@ -51,11 +51,22 @@ NEWS - user visible changes -*- outline -*-
** Initial "testing support" of CODE-SET clause to convert between ASCII and
EBCDIC on READ/WRITE/REWRITE for sequential and line-sequential files

** Initial "testing support" of FLOAT-EXTENDED (long double type)

** minimal "parsing support" for USAGE UTF-8 and UTF-8 literals

** Support to exit the runtime from COBOL as hard error (including possible
[core-]dump and stacktrace) with "STOP ERROR" statement or by
CALL "CBL_RUNTIME_ERROR"

** TODO - More to document, hopefully before 3.2rc-1
** COB_PHYSICAL_CANCEL may now be configured as "never" to prevent unloading,
of COBOL modules, both on CANCEL and on process exit, which is useful for
analysis tools like callgrind or perf to keep all symbols until the end of
the COBOL process

** the system function x'91' was extended to support more functions

** TODO - More to document before 3.2 final


* Changes that potentially effects existing programs:
Expand All @@ -78,10 +89,11 @@ NEWS - user visible changes -*- outline -*-
format "COB_VARSEQ_TYPE = 0" contains two NULL bytes this will likely
make most LINE SEQUENTIAL files not declared as this type fail on OPEN

** LINE SEQUENTIAL files, data validation: in case of non-printable data
a READ may result in io status 09 and WRITE may error with io status 71;
to disable this validation see the new runtime option COB_LS_VALIDATE
to restore old behavior and to increase performance on WRITE;
** LINE SEQUENTIAL files, data validation: in case of bad printable data
(less than SPACE) a READ may result in io status 09 and WRITE may error
with io status 71; see the new runtime option COB_LS_VALIDATE to disable
this validation (= old behavior) and to increase performance on line
sequential file io;
if LS_NULLS is active and invalid data (bad encoded or missing encoding)
is found io status 71 is returned

Expand Down Expand Up @@ -144,6 +156,11 @@ NEWS - user visible changes -*- outline -*-
of the color-number, leading to a previous value of 21 (which was ignored
until now) being interpreted as 5, see FR #387

** the programmable runtime switches "SWITCH A" through "SWITCH Z" internally
used 1-26 and now use 11-36 to be able to combine then with switches 0-7;
if you set those via COB_SWITCH environment variables you need to adjust
their numbers

* Changes that potentially effects recompilation of existing programs:

** the reserved word list and intrinsic functions was updated, especially
Expand Down Expand Up @@ -212,12 +229,15 @@ NEWS - user visible changes -*- outline -*-
affected programs (with OCCURS DEPENDING ON) or compile with additional
-fno-odoslide to get the same results as with older GnuCOBOL versions

** the compile flag -fdefaultbyte was moved to a dialect configuration,
** the compile flag -fdefaultbyte (initializarion for data-items without
an explicit VALUE) was moved to a dialect configuration;
while -fdefaultbyte still works as before it is now implied as binary
zero with -std=ibm/mvs/bs2000, space for -std=mf/acu/rm/realia, and
zero with -std=ibm/mvs/bs2000/realia, space for -std=mf/acu/rm, and
no defined initialization for -std=cobol85/cobol2002/cobol2014/xopen,
it is unchanged for -std=default (initialize to PICTURE/USAGE)
for compatibility to previous behavior compile with -fdefaultbyte=init
it is unchanged for -std=default (initialize to PICTURE/USAGE);
for compatibility to previous behavior compile with -fdefaultbyte=init;
note that initialization for INDEXED BY items honors the defaultbyte
configuration now, too

** the dialect configuration option larger-redefines-ok was changed to
a support option larger-redefines; if specified on the command-line
Expand All @@ -232,7 +252,8 @@ NEWS - user visible changes -*- outline -*-
to use this extension for other dialects use the new
-fself-call-recursive=warning (or "ok")

** the option -g does not longer imply -fsource-location
** the option -g does not longer imply -fsource-location; but it auto-includes
references to the COBOL-paragraphs to further ease source level debugging

** new flag -fstack-extended (implied with --debug and --dump) to include
the origin of entrypoints and PERFORM, this is used for the internal
Expand Down Expand Up @@ -263,6 +284,18 @@ NEWS - user visible changes -*- outline -*-
** new compiler command line option to list the known runtime exception names
and fatality `cobc --list-exceptions`

** new compiler command line option -ftcmd to enable printing of the command
line in the source listing

** new compiler command line option --coverage to instrument binaries
for coverage checks

** the command line options -MT and -MF, which are used for creating a
dependency list (used copybooks) to be used for inclusion in Makefiles
or other processes, and which were removed in GnuCOBOL 2 are back in their
original version; note: their use will be adjusted where they don't match
GCC's same options in later versions, including addition of -M and -MD

** New -std options:

gcos GCOS compatibility
Expand Down Expand Up @@ -300,6 +333,9 @@ NEWS - user visible changes -*- outline -*-
longer loading time and longer compile times; if you use those a recompile
is highly suggested

** several bugs in COPY REPLACING / REPLACING were fixed along with adding
support for exensions related to REPLACING LEADING / TRAILING

* Listing changes

** the timestamp in the header was changed from ANSI date format like
Expand Down Expand Up @@ -341,15 +377,16 @@ NEWS - user visible changes -*- outline -*-

** execution times were significantly reduced for the following:
INSPECT that use big COBOL fields (multiple KB)
MOVE and comparisions (especially with enabled runtime checks, to
optimize those a re-compile is needed)
CALL data-item, and first time for each CALL
ACCEPT DATE/TIME/DAY and datetime related FUNCTIONs
MOVE with enabled runtime checks (only with re-compile)

** execution times for programs that are new generated with -fsource-location
(implied with --debug/-fec) are cut down, especially when many "simple"
statements or lot of sections/paragraphs are used; also the runtime checks
for use of LINKAGE fields and/or subscripts/reference-modification will be
much faster
ACCEPT DATE/TIME/DAY, most if numeric items are accepted
datetime related FUNCTIONs
runtime checks for use of LINKAGE/BASED fields and/or
subscripts/reference-modification (re-compile needed)
general: execution of programs generated with -fsource-location
(implied with --debug and -fec), especially when many "simple"
statements or lot of sections/paragraphs are used (re-compile needed)

* New build features

Expand All @@ -359,16 +396,18 @@ NEWS - user visible changes -*- outline -*-
(experimental)
** configure now checks for PERL and passes that as default to make test
** cobc handles SOURCE_DATE_EPOCH now, allowing to override timestamps in
generated code and listing files, allowing reproducible builds
generated code and listing files, allowing reproducible builds of both
GnuCOBOL (extras folder) and COBOL programs

* Obsolete features (will be removed in the next version if no explicit user
requests are raised)

** use of old non-GMP randomizer for FUNCTION RANDOM

* Known issues in 3.2 (and 3.1)
** undocumented option -tsymbols, which was replaced by -ftsymbols in 3.0


** 3.2 only: the testing and documentation for COB_CORE_ON_ERROR is unfinished
* Known issues in 3.2 (and 3.1)

** testsuite:
* if built with vbisam, cisam or disam, depending on the version used, some
Expand All @@ -384,12 +423,13 @@ NEWS - user visible changes -*- outline -*-
as expected in all cases

** floating-point comparison for equality may return unexpected results as it
involves a necessary tolerance; we seek input for a reasonable default for
GnuCOBOL 4 (use the mailing list or discussion board to share your comments
on this topic, keep in mind that this has to take both mathematical and
"C compiler portability" into account); you may adjust the default
tolerance of 0.0000001 by compiling GnuCOBOL for example with
LIBCOB_CPPFLAGS="-DCOB_FLOAT_DELTA=0.0000000000001"
involves a necessary tolerance; you may adjust the default tolerance of
0.0000001 by compiling GnuCOBOL for example with
LIBCOB_CPPFLAGS="-DCOB_FLOAT_DELTA=0.0000000000001";
we seek input for a reasonable default for GnuCOBOL 4 (use the mailing list
or discussion board to share your comments on this topic, keeping in mind
that this has to take both mathematical and "C compiler portability" into
account)

** features that are known to not be portable to every environment yet
(especially when using a different compiler than GCC)
Expand Down
7 changes: 7 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ l_exit:
As a third alternative we can just add a flag that says
"assume I never go out of a section".

4.3 optimizing cob_move_display_to_edited

This function is relative often called in production systems and
re-calculates the picture on runtime, which the compiler already
did - pass this information along with the call.

5 Debugging support

Expand All @@ -185,6 +189,9 @@ access the COBOL data at debugging time.
Note: GnuCOBOL 3 implemented this partially, using extensions
near full GDB support is already possible.

GnuCOBOL 4 provides this quite complete at runtime, too.


6 Better user manual

Yes, we should, for now: refer to the GnuCOBOL Programmer's Guide
Expand Down
4 changes: 2 additions & 2 deletions autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Bootstrap gnucobol package from checked-out sources
# Note: call as ./autogen.sh if you don't have readlink -f
#
# Copyright (C) 2019,2022 Free Software Foundation, Inc.
# Copyright (C) 2019,2022,2023 Free Software Foundation, Inc.
# Written by Simon Sobisch
#
# This file is part of GnuCOBOL.
Expand Down Expand Up @@ -32,7 +32,7 @@ else
GCMAINPATH="$MAINPATH"
fi
if test ! -f $MAINPATH/$me; then
echo; echo "ERROR - cannot set main directory [checked $MAINPATH/build_aux/$me] - aborting $me" && exit 1
echo; echo "ERROR - cannot set main directory [checked $MAINPATH/$me] - aborting $me" && exit 1
fi

olddir_autogen=`pwd`
Expand Down
28 changes: 13 additions & 15 deletions bin/cobcrun.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2004-2012, 2014-2022 Free Software Foundation, Inc.
Copyright (C) 2004-2012, 2014-2023 Free Software Foundation, Inc.
Written by Roger While, Simon Sobisch, Brian Tiffin
This file is part of GnuCOBOL.
Expand Down Expand Up @@ -96,7 +96,7 @@ cobcrun_print_version (void)
}

printf ("cobcrun (%s) %s.%d\n", PACKAGE_NAME, PACKAGE_VERSION, PATCH_LEVEL);
puts ("Copyright (C) 2022 Free Software Foundation, Inc.");
puts ("Copyright (C) 2023 Free Software Foundation, Inc.");
printf (_("License GPLv3+: GNU GPL version 3 or later <%s>"), "https://gnu.org/licenses/gpl.html");
putchar ('\n');
puts (_("This is free software; see the source for copying conditions. There is NO\n"
Expand Down Expand Up @@ -191,30 +191,28 @@ cobcrun_initial_module (char *module_argument)
{
char *pathname, *filename;
char env_space[COB_MEDIUM_BUFF], *envptr;

/* FIXME: split in two functions (one setting module, one setting path)
after allowing module with path in COB_PRE_LOAD */

/* LCOV_EXCL_START */
if (!module_argument) {
/* never reached (getopt ensures that we have an argument),
just in to keep the analyzer happy, so msg untranslated */
return "missing argument";
/* LCOV_EXCL_STOP */
} else if (module_argument[0] == 0) {
/* note: getopt ensures that we have an argument, but it may be empty */
if (module_argument[0] == 0) {
return ""; /* used as "no further information" */
}

#if 0 /* CHECKME: Do we want that validation here or handle it? */
if (strchr (module_argument, PATHSEP_CHAR)) {
return ("should not contain '%c'", PATHSEP_CHAR);
static char [COB_MINI_BUFF] buff;
snprintf (buff, COB_MINI_MAX, _("should not contain '%c'"), PATHSEP_CHAR);
return buff;
}
#endif

/* See if we have a /dir/path/module, or a /dir/path/ or a module (no slash) */
cobcrun_split_path_file (&pathname, &filename, module_argument);
if (*pathname) {
/* TODO: check content, see libcob/common.h */
envptr = getenv ("COB_LIBRARY_PATH");
/* TODO: check content, see libcob/common.c/h to raise error message */
envptr = cob_getenv_direct ("COB_LIBRARY_PATH");
if (envptr
&& strlen (envptr) + strlen (pathname) + 1 < COB_MEDIUM_MAX) {
memset (env_space, 0, COB_MEDIUM_BUFF);
Expand All @@ -229,8 +227,8 @@ cobcrun_initial_module (char *module_argument)
cob_free((void *)pathname);

if (*filename) {
/* TODO: check content, see libcob/common.h */
envptr = getenv ("COB_PRE_LOAD");
/* TODO: check content, see libcob/common.c/h to raise error message */
envptr = cob_getenv_direct ("COB_PRE_LOAD");
if (envptr
&& strlen (envptr) + strlen (filename) + 1 < COB_MEDIUM_MAX) {
memset (env_space, 0, COB_MEDIUM_BUFF);
Expand All @@ -256,7 +254,7 @@ process_command_line (int argc, char *argv[])
const char *err_msg;

#if defined (_WIN32) || defined (__DJGPP__)
if (!getenv ("POSIXLY_CORRECT")) {
if (!cob_getenv_direct ("POSIXLY_CORRECT")) {
/* Translate command line arguments from DOS/WIN to UNIX style */
int argnum = 0;
while (++argnum < argc) {
Expand Down
Loading

0 comments on commit 516b813

Please sign in to comment.