Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into gc4
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeclerck committed Jan 8, 2025
2 parents 929f8be + 0065f42 commit 9707c4d
Show file tree
Hide file tree
Showing 34 changed files with 30,375 additions and 606 deletions.
10 changes: 7 additions & 3 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
* configure.ac: update flags for building dynamic libraries on macOS
(helps fixing testsuite issues on recent macOS versions)

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 @@ -187,7 +191,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 @@ -201,7 +205,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 @@ -362,7 +366,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
45 changes: 32 additions & 13 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,15 @@ Open Plans:
of the color-number, leading to a previous value of 21 (which was ignored
until now) being interpreted as 5, see FR #387

** extended screen io with single-fields: runtime-adjustable attributes by
support of extension clauses COLOR and CONTROL for ACCEPT and DISPLAY
statements, see FR #189 + FR #355; note: while COLOR and CONTROL are parsed
for SCREEN SECTION they are ignored at runtime

** extended screen io with single-fields: the ACCEPT statement now supports
the extension CURSOR clause, additional to the standard-defined
CONTROL phrase in SPECIAL-NAMES

** 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
Expand All @@ -250,17 +259,17 @@ Open Plans:

* 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):
** 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
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 @@ -331,7 +340,7 @@ Open Plans:
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 @@ -342,6 +351,11 @@ Open Plans:
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 @@ -442,8 +456,9 @@ Open Plans:
** in 64-bit environments, the maximum field size was increased from
268435456 bytes (999999998 bytes for OCCURS UNBOUNDED) to 2 GB

** the call-stack on error / in the dump file now contains all parameters given
to the program via command line options, if any
** 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

** in case of any runtime features being used that are not available an error
is generated during compile (may be reduced to a warning by -Wunsupported
Expand Down Expand Up @@ -485,6 +500,10 @@ Open Plans:
(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
6 changes: 6 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ https://sourceforge.net/p/gnucobol/code/HEAD/tree/external-doc/guide/

- Investigate the CHECKME about moving cob_set_exception call in common.c:cob_module_global_enter

- Investigate the CHECKME about single-digit optimization in numeric.c:cob_add_int

- Check the TODO about cb_default_byte in codegen.c:output_initialize

- Make status an enum instead of an int in fileio.c:cob_file_save_status as per TODO
Expand All @@ -249,3 +251,7 @@ https://sourceforge.net/p/gnucobol/code/HEAD/tree/external-doc/guide/
- Check what we should do about the casts used to remove const on open_mode in fileio.c and others (eg. in cob_file_open)

- Investigate failed manual tests "CRT STATUS clause" and "X/Open CRT STATUS clause" (see r4180)

- Check use of new integer optimization in cb_build_optim_sub and cb_build_optim_add - those may be slower than cob_add_packed_int/cob_add_packed_int64

- If there's a reasonable performance benefit for the integer optimizations for BCD/DISPLAY: add an option -funsigned-zero which never stores a sign in those (or in one of those, depending on a perf stat result) to provide the option to still use this optimization
5 changes: 4 additions & 1 deletion build_windows/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,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 @@ -704,6 +704,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
60 changes: 60 additions & 0 deletions cobc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,64 @@
* typeck.c (cb_emit_sort_init): generate call to cob_file_sort_options
* help.c (cobc_print_usage_dialect): extended -fregister help

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
literal for use with CONTROL phrase
* parser.y: adjust a bunch of terminals to match the internal name with
leading underscore as optional

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

* cobc.c (set_category, set_category_from_usage): changed argument types
from int to their matching enum
* tree.c (cb_build_prototype), parser.y (setup_prototype),
tree.h (struct cb_prototype): use matching enum

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

* cobc.c (cobc_check_valid_name): allow leading underscore,
Expand Down Expand Up @@ -323,6 +381,8 @@
* parser.y (usage_clause_screen_report), typeck.c (validate_usage): have
REPORT and SCREEN section only expecting the possibly USAGEs instead all
removing the need to check for bad USAGE later
* parser.y (display_erase, display_pos_specifier): pass display attributes
to codegen

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

Expand Down
17 changes: 10 additions & 7 deletions cobc/cobc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3136,6 +3136,7 @@ process_command_line (const int argc, char **argv)
cb_flag_optimize_check = 0;
strip_output = 0;
cb_constant_folding = 0;
cb_flag_remove_unreachable = 0;
copt = CB_COPT_0;
break;

Expand Down Expand Up @@ -3170,15 +3171,14 @@ process_command_line (const int argc, char **argv)
/* -g : Generate C debug code */
save_all_src = 1;
cb_source_debugging = 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_stack_check = 1;
cb_flag_symbols = 1;
cb_flag_remove_unreachable = 0;
#ifdef COB_DEBUG_FLAGS
COBC_ADD_STR (cobc_cflags, " ", cobc_debug_flags, NULL);
#endif
Expand Down Expand Up @@ -4462,7 +4462,7 @@ process_filename (const char *filename)
#endif
}

cob_incr_temp_iteration();
cob_incr_temp_iteration ();
return fn;
}

Expand Down Expand Up @@ -5530,7 +5530,7 @@ set_picture (struct cb_field *field, char *picture, size_t picture_len)
}

static void
set_category_from_usage (int usage, char *type)
set_category_from_usage (const enum cb_usage usage, char *type)
{
switch (usage) {
case CB_USAGE_INDEX:
Expand All @@ -5556,7 +5556,8 @@ set_category_from_usage (int usage, char *type)
}

static void
set_category (int category, int usage, char *type)
set_category (const enum cb_category category, const enum cb_usage usage,
char *type)
{
switch (category) {
case CB_CATEGORY_UNKNOWN:
Expand Down Expand Up @@ -5660,8 +5661,10 @@ print_fields (struct cb_field *top, int *found)
if (top->children) {
strcpy (type, "GROUP");
if (!top->external_definition) {
/* group never has a PICTURE ... */
got_picture = 0;
} else {
/* ...still output definitions for TYPEDEF / SAME AS */
got_picture = set_picture (top, picture, picture_len);
}
} else {
Expand All @@ -5672,7 +5675,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 @@ -5885,11 +5885,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 9707c4d

Please sign in to comment.