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 Jun 2, 2023
2 parents 1992539 + 1da2a91 commit cca51ff
Show file tree
Hide file tree
Showing 38 changed files with 30,208 additions and 673 deletions.
12 changes: 8 additions & 4 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

2023-05-25 Chuck Haatvedt <[email protected]>

* configure.ac: added test for HAVE_RESIZE_TERM function

2023-04-25 Simon Sobisch <[email protected]>

* configure.ac: try to error on warnings during checks, cleanup of resulting
Expand Down Expand Up @@ -173,7 +177,7 @@
* general: revert change 2019-06-05 - all header files that are included
from the system use <include.h>, "local.h" is used otherwise with the
exceptions of to-be-installed headers which include files that have a
local reference to each other after installation (common.h +
local reference to each other after installation (common.h +
and exceptions.def)

2021-12-30 Simon Sobisch <[email protected]>
Expand All @@ -187,7 +191,7 @@

* configure.ac: use `dnl` comments in all places that are not intended be
included in the generated configure script, fixing spurious warnings
about potentially undefined macros;
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)
Expand Down Expand Up @@ -280,7 +284,7 @@

2020-10-23 Simon Sobisch <[email protected]>

* configure.ac: version check for json-c/cJSON "poor man's check"
* configure.ac: version check for json-c/cJSON "poor man's check"

2020-10-06 Simon Sobisch <[email protected]>

Expand Down Expand Up @@ -695,7 +699,7 @@
always have to be executed and don't result in a file,
define prerequisites to fix parallel builds

2017-05-31 Ron Norman <[email protected]>
2017-05-31 Ron Norman <[email protected]>

* configure.ac: set COB_HAS_ISAM to type of ISAM handler instead of 'yes'
'cisam', 'disam', 'vbisam', 'db', 'index_extfh' - if no ISAM then it is
Expand Down
37 changes: 25 additions & 12 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,17 @@ NEWS - user visible changes -*- outline -*-

* Changes to the COBOL compiler (cobc) options:

** new -fformat dialect option, and extended SOURCE FORMAT directives, with
the following newly supported reference-formats (in addition to
FIXED/FREE):

COBOL85 Fixed-form format with enforcement of Area A
COBOLX GCOS 7 extended format
CRT ICOBOL Free-form format
TERMINAL ACUCOBOL-GT Terminal format
VARIABLE Micro Focus Variable Fixed-form format
XCARD ICOBOL xCard (extended card) format
XOPEN X/Open Free-form format
** new -fformat dialect option, and extended SOURCE FORMAT directives,
with the following newly supported reference-formats (in addition
to FIXED/FREE):

COBOL85 Fixed-form format with enforcement of Area A
COBOLX GCOS 7 extended format
CRT ICOBOL Free-form format
TERMINAL ACUCOBOL-GT Terminal format
VARIABLE Micro Focus Variable Fixed-form format
XCARD ICOBOL xCard (extended card) format
XOPEN X/Open Free-form format

These formats come with Area A enforcement (except for XOPEN), that
checks whether division, section, and paragraph names start in Area
Expand Down Expand Up @@ -268,7 +268,7 @@ 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; but it auto-includes
** the option -g does no longer imply -fsource-location; but it auto-includes
references to the COBOL-paragraphs to further ease source level debugging

** -fsource-location generates source references to copyboooks in DATA
Expand All @@ -279,6 +279,11 @@ NEWS - user visible changes -*- outline -*-
the origin of entrypoints and PERFORM, this is used for the internal
stack trace on abort and can be used for improved source level debugging

** the option -g does no longer imply -fno-remove-unreachable; if you want to
keep those in you need to explicit specify this

** the option -O0 now implies -fno-remove-unreachable

** new options to ensure structured code-flow:
-fsection-exit-check to ensure sections don't "fall through" (are always
entered and left by PERFORM)
Expand Down Expand Up @@ -379,6 +384,10 @@ NEWS - user visible changes -*- outline -*-
** in 64-bit environments, the maximum field size was increased from
268435456 bytes (999999998 bytes for OCCURS UNBOUNDED) to 2 GB

** numeric DISPLAY can store and may contain a positive zero after arithmetic,
PACKED-DECIMAL may contain negative zero (x'0D') after arithmetic; as before
numeric comparisions to ZERO / 0 / +0 / -0 will all be identical

** quotes around filenames and parts that are resolved by environment variables
are internally ignored

Expand Down Expand Up @@ -422,6 +431,10 @@ NEWS - user visible changes -*- outline -*-
(implied with --debug and -fec), especially when many "simple"
statements or lot of sections/paragraphs are used (re-compile needed)

* New system functions

CBL_GC_SET_SCR_SIZE option to resize extended screen

* New build features

** configure now honors BDB_LIBS and BDB_CFLAGS
Expand Down
5 changes: 5 additions & 0 deletions build_windows/ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

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

* makedist.cmd: first addition for CI output
* version_cobc.rc, version_libcob.rc: updated date + rev

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

* version_cobc.rc, version_libcob.rc: updated date + rev
Expand Down
5 changes: 4 additions & 1 deletion build_windows/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@
/* #undef HAVE_COLOR_SET */
#endif

/* ncurses has _nc_freeall function */
/* curses provides function to free all memory */
/* #undef HAVE_CURSES_FREEALL */

/* Define to 1 if you have the <curses.h> header file. */
Expand Down Expand Up @@ -638,6 +638,9 @@
/* #undef HAVE_REALPATH */
#endif

/* curses has resize_term function */
#define HAVE_RESIZE_TERM 1

/* Define to 1 if you have the `setenv' function. */
/* MSC does *NOT* have `setenv' (!)
But as the handling of the fallback `putenv' is different in POSIX and _MSC
Expand Down
26 changes: 23 additions & 3 deletions build_windows/makedist.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:: Copyright (C) 2014-2022 Free Software Foundation, Inc.
:: Copyright (C) 2014-2023 Free Software Foundation, Inc.
:: Written by Simon Sobisch, Edward Hart
::
:: This file is part of GnuCOBOL.
Expand Down Expand Up @@ -225,7 +225,12 @@ if exist "%ProgramFiles%\7-Zip\7z.exe" (
goto :end
)
echo.
echo %cob_build_path%%DIST_PACKAGE%.7z ready for distribution.

if "%APPVEYOR%"=="True" (
appveyor AddMessage "%cob_build_path%%DIST_PACKAGE%.7z ready for distribution." -Category Information
) else (
echo %cob_build_path%%DIST_PACKAGE%.7z ready for distribution.
)

goto :end

Expand Down Expand Up @@ -369,7 +374,8 @@ goto :eof
setlocal
call :set_platform_and_ext %1%
set "stay_open="
echo Using created GnuCOBOL distribution -%platform%- to compile extras...

echo Setup using created GnuCOBOL distribution -%platform%-...
pushd "%cob_dist_path%bin_%platform_ext%"
call ..\set_env_vs_%platform_ext%.cmd
if not [%VCPKG_EXPORT_DIR%]==[] (
Expand All @@ -379,6 +385,20 @@ if not [%VCPKG_EXPORT_DIR%]==[] (
) else (
set "extra_include=."
)

cobcrun -vV | findstr /c:"GnuCOBOL " > vers1
cobcrun -vV | findstr /c:MPIR /c:GMP > vers2
set /p vers1=<vers1
set /p vers2=<vers2
erase /Q vers*
if "%APPVEYOR%"=="True" goto :appveyor
echo Building extras with %vers1% %vers2%
goto :next
:appveyor
appveyor AddMessage "Building extras with %vers1% %vers2%" -Category Information
goto :next
:next

cobc -m -Wall -O2 -I "%extra_include%" ..\extras\CBL_OC_DUMP.cob
if %errorlevel% neq 0 (
echo.
Expand Down
4 changes: 2 additions & 2 deletions build_windows/version_cobc.rc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "config.h"

#include "../libcob/version.h"
#define VCS_REF 4982
#define VCS_REF 5055

#define STRINGIZE_DETAIL_(v) #v
#define STRINGIZE(v) STRINGIZE_DETAIL_(v)
Expand Down Expand Up @@ -55,7 +55,7 @@ VS_VERSION_INFO VERSIONINFO
VALUE "SpecialBuild", ""

/* Non-Standard entries */
VALUE "Build", "Feb 2023"
VALUE "Build", "May 2023"
VALUE "Developer", "Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart and many others (see AUTHORS and THANKS)"
VALUE "Support", "https://www.gnu.org/software/gnucobol/"
VALUE "Users", "Unlimited."
Expand Down
4 changes: 2 additions & 2 deletions build_windows/version_libcob.rc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "config.h"

#include "../libcob/version.h"
#define VCS_REF 4982
#define VCS_REF 5059

#define STRINGIZE_DETAIL_(v) #v
#define STRINGIZE(v) STRINGIZE_DETAIL_(v)
Expand Down Expand Up @@ -55,7 +55,7 @@ VS_VERSION_INFO VERSIONINFO
VALUE "SpecialBuild", ""

/* Non-Standard entries */
VALUE "Build", "Feb 2023"
VALUE "Build", "May 2023"
VALUE "Developer", "Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart and many others (see AUTHORS and THANKS)"
VALUE "Support", "https://www.gnu.org/software/gnucobol/"
VALUE "Users", "Unlimited."
Expand Down
44 changes: 44 additions & 0 deletions cobc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,48 @@

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

* codegen.c (output_init_comment_and_source_ref) [NO_INIT_SOURCE_LOC]:
option to skip generating the source location in DATA DIVISION

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

* typeck.y (is_subordinate_to): start with parent, not field

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

* parser.y: allow expressions for screen related clauses
COL, LINE, LINES, SIZE, COLOR

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

* parser.y, reserved.c: added RIGHTLINE - GC extension matching LEFLINE
* parser.y: drop PENDING from OVERLINE and LEFTLINE

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

* cobc.c: disable unreached code removement with -O0, but keep it
unchanged for -g
* field.c (validate_field_1): moved check for duplicate report LINE and
"OCCURS with multi COLUMNs" here, originally found in (compute_size)
* field.c (get_max_int_val): new function to get the highest algebraic
integer value
* field.c (compute_size): limit internal computed maximum for UNBOUNDED
item to the maximum value that can be stored in its DEPENDING on item
* field.c (compute_size): set items that are too big to a fixed value
to return eraly on follow-up checks
* field.c (compute_size): disabled check for missing PIC for NATIONAL
and BCD USAGE
* tree.c (cb_field_variable_address), tree.h: disabled unused function
* tree.c (cb_field_has_unbounded), tree.h: new function checking both
field and any of the child elements to be UNBOUNDED
* typeck.c (cb_validate_program_data): validate DEPENDING ON to be numeric
* typeck.c (cb_build_identifier): skip compile-time checks for ref-mod
on UNBOUNDED items as size is not known; for runtime calculate the max.
length for ref-mod using the ODO
* parser.y (occurs_clause): don't set flag_unbounded in parent
* cobc.c (print_fields): don't output (wrong) size for group items with
OCCURS UNBOUNDED sub-fields

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

* parser.y (control_source): allow both an alphanumeric identifier or
Expand Down
10 changes: 5 additions & 5 deletions cobc/cobc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3113,6 +3113,7 @@ process_command_line (const int argc, char **argv)
cob_optimize = 0;
strip_output = 0;
cb_constant_folding = 0;
cb_flag_remove_unreachable = 0;
copt = CB_COPT_0;
break;

Expand Down Expand Up @@ -3148,13 +3149,12 @@ process_command_line (const int argc, char **argv)
save_all_src = 1;
cb_source_debugging = 1;
cb_flag_stack_check = 1;
/* note: cb_flag_source_location and cb_flag_stack_extended
are explicit not set here */
/* note: cb_flag_source_location, cb_flag_stack_extended and
cb_flag_remove_unreachable are explicit not set here */
#if 1 /* auto-included, may be disabled manually if needed */
cb_flag_c_line_directives = 1;
cb_flag_c_labels = 1;
#endif
cb_flag_remove_unreachable = 0;
#ifdef COB_DEBUG_FLAGS
COBC_ADD_STR (cobc_cflags, " ", cobc_debug_flags, NULL);
#endif
Expand Down Expand Up @@ -5560,7 +5560,7 @@ print_fields (struct cb_field *top, int *found)
/* group never has a PICTURE ... */
got_picture = 0;
} else {
/* ...stilll output definitions for TYPEDEF / SAME AS */
/* ...still output definitions for TYPEDEF / SAME AS */
got_picture = set_picture (top, picture, picture_len);
}
} else {
Expand All @@ -5571,7 +5571,7 @@ print_fields (struct cb_field *top, int *found)
got_picture = set_picture (top, picture, picture_len);
}

if (top->flag_any_length || top->flag_unbounded) {
if (top->flag_any_length || cb_field_has_unbounded (top)) {
pd_off = sprintf (print_data, "????? ");
} else if (top->flag_occurs && !got_picture) {
pd_off = sprintf (print_data, "%05d ", top->size * top->occurs_max);
Expand Down
5 changes: 5 additions & 0 deletions cobc/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -5178,11 +5178,16 @@ output_init_comment_and_source_ref (struct cb_field *f)
{
/* output comment and source location for each field */
output_line ("/* initialize field %s */", f->name);
#ifndef NO_INIT_SOURCE_LOC /* allow user to not output these;
note: this will lead to a COBOL step never land in the
DATA DIVISION; it will also lead to not be able to list
copybooks in there to be visible to the debugger */
if (cb_flag_c_line_directives && f->common.source_line) {
output_cobol_info (CB_TREE (f));
output_line ("cob_nop ();");
output_c_info ();
}
#endif
}

static void
Expand Down
Loading

0 comments on commit cca51ff

Please sign in to comment.