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 May 24, 2023
2 parents fcd562f + 412c46a commit 1992539
Show file tree
Hide file tree
Showing 38 changed files with 42,545 additions and 10,928 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@

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

* configure.ac: try to error on warnings during checks, cleanup of resulting
unexpected test failures
* configure.ac: drop deprecated-non-prototype warning in clang
* configure.ac: add LIBCOB_LIBS while checking for libraries
* configure.ac: added check for HAVE_ATTRIBUTE_CONSTRUCTOR

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

* configure.ac: pass --enable-debug to autoconf generated files as
Expand Down
15 changes: 14 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ NEWS - user visible changes -*- outline -*-

planned for final:
* extending testsuite and documentation
* configure: minor checking to set TIME_T_IS_NON_ARITHMETIC
* investigation of code analysis tools and user feedback


Expand Down Expand Up @@ -157,6 +156,15 @@ 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

** 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 Down Expand Up @@ -352,6 +360,11 @@ NEWS - user visible changes -*- outline -*-
previous versions; sources with *leading* P never worked correct before,
and *must* be recompiled after upgrading

** since its addition to GnuCOBOL ROUNDING MODE PROHIBITED just prevented
rounding; its behaviour changed to match the specification by doing that,
raising EC-SIZE-TRUNCATION and changed: not adjust the target field if
rounding would be necessary to store the data

* Listing changes

** the timestamp in the header was changed from ANSI date format like
Expand Down
11 changes: 9 additions & 2 deletions build_windows/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,13 @@
/* #undef HAVE_ATTRIBUTE_ALIGNED */
#endif

/* Has __attribute__((constructor)) */
#if defined(__ORANGEC__)
#define HAVE_ATTRIBUTE_CONSTRUCTOR 1
#else
/* #undef HAVE_ATTRIBUTE_CONSTRUCTOR - using DllMain */
#endif

/* Define to 1 if you have the `canonicalize_file_name' function. */
#if defined(__ORANGEC__)
#define HAVE_CANONICALIZE_FILE_NAME 1
Expand Down Expand Up @@ -744,8 +751,8 @@
/* Define to 1 if you have the <xcurses/curses.h> header file. */
/* #undef HAVE_XCURSES_CURSES_H */

/* Define to 1 if you have the <wchar.h> header file. */
#define HAVE_WCHAR_H 1
/* Define to 1 if you have the <xcurses.h> header file. */
/* #undef HAVE_XCURSES_H */

/* Define to the sub-directory where libtool stores uninstalled libraries. */
/* #undef LT_OBJDIR */
Expand Down
88 changes: 87 additions & 1 deletion cobc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,88 @@

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,
prevent leading hyphen
* scanner.l (error_literal): change parameter literal_error to unsigned
and raise only a warning for negative values, adjust callers
* scanner.l (scan_x): internally handle odd numbers of x'' literals,
raise only a warning if the size is 1 and relaxed-syntax is active
* parser.y (data_description): improve error handling in DATA DIVISION
to raise less errors and create "validated invalid" fields

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

* field.c (cb_build_field_tree), parser.y: copy SCREEN SECTION
attributes from parent - instead of doing it in the parser
* parser.y (validate_screen_attributes): extracted duplicate code
* typeck.c (emit_field_accept_display): new function extracted
from (cb_emit_accept), handling both DISPLAY and ACCEPT
* typeck.c (cob_field_display): dropped, replaced in the callers
by call to (emit_field_accept_display) for not generating a call to
fixed-attribute "cob_field_display" but to the varargs
function "cob_display_field"
* codegen.c (output_screen_init), codeoptim.c (COB_SET_SCREEN):
generate screen init not as separate function "cob_set_screen" but
as macro "COB_SET_SCREEN" (there's no need or use to put all
attributes on the stack)

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

* codegen.c (output_funcall): backup and restore adjusted static fields,
minor refactoring
* codegen.c (output_funcall_item): extracted from (output_funcall)
* typeck.c (cb_emit_accept): dropped cb_gen_field_accept and don't generate
call to fixed-attribute "cob_field_accept", instead generate a call to
the varargs function "cob_accept_field" with passing only the attributes
that are set (including the new CONTROL, COLOR and CURSOR)

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

* tree.c (cb_build_funcall), tree.h (struct cb_funcall): defined
max. parameters for internal function calls as CB_BUILD_FUNCALL_MAX
and increased it to 14

FR #189 + FR #355 - runtime-adjustable attributes for extended screenio
* tree.h (cb_field): new attributes screen_control and screen_color
* tree.h (cb_attr_struct): new attributes control, color and cursor
* parser.y, typeck.c (validate_attrs, cb_emit_accept, cb_emit_display,
emit_field_display_for_last): add complete parsing for CONTROL,
COLOR and CURSOR and set/read new attributes as appropriate
* parser.y: pass COB_SCREEN_CONV to runtime (currently not handled)

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

* field.c (cb_resolve_redefines): fix #881 wrong REDEFINES error on
fields with redefinition

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

* typeck.c (cb_build_move_literal): restore writing of negative zero
(DISPLAY overpunched), that was removed undocumented with 2.0
* typeck.c (cb_build_move_literal): optimized output for literals to
fields with BLANK WHEN ZERO and SIGN LEADING

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

* codegen.c (output_so_load_version_check): new function to generate
libcob version check in shared object constructor / DllMain, allowing
better error messages if the generated COBOL functions cannot be loaded
into memory because of newer ABI

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

* typeck.c (cb_build_move_field): emit call to cob_move_bcd for two
Expand Down Expand Up @@ -184,6 +268,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 Expand Up @@ -4035,7 +4121,7 @@

2017-10-18 Ron Norman <[email protected]>

* codegen.c (output_internal_function): Fixed problem with braces in
* codegen.c (output_internal_function): fixed problem with braces in
variable dump code

2017-10-17 Ron Norman <[email protected]>
Expand Down
24 changes: 14 additions & 10 deletions cobc/cobc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1505,7 +1505,7 @@ cobc_bcompare (const void *p1, const void *p2)
enum name_error_reason {
INVALID_LENGTH = 1,
EMPTY_NAME,
SPACE_UNDERSCORE_FIRST_CHAR,
SPACE_HYPHEN_FIRST_CHAR,
GNUCOBOL_PREFIX,
C_KEYWORD,
CONTAINS_DIRECTORY_SEPARATOR
Expand All @@ -1525,8 +1525,8 @@ cobc_error_name (const char *name, const enum cobc_name_type type,
case EMPTY_NAME:
s = _(" - name cannot be empty");
break;
case SPACE_UNDERSCORE_FIRST_CHAR:
s = _(" - name cannot begin with space or underscore");
case SPACE_HYPHEN_FIRST_CHAR:
s = _(" - name cannot begin with space or hyphen");
break;
case GNUCOBOL_PREFIX:
s = _(" - name cannot begin with 'cob_' or 'COB_'");
Expand Down Expand Up @@ -1596,8 +1596,8 @@ cobc_check_valid_name (const char *name, const enum cobc_name_type prechk)
/* missing check (here): encoded length > internal buffer,
see cob_encode_program_id */

if (*name == '_' || *name == ' ') {
cobc_error_name (name, prechk, SPACE_UNDERSCORE_FIRST_CHAR);
if (*name == '-' || *name == ' ') {
cobc_error_name (name, prechk, SPACE_HYPHEN_FIRST_CHAR);
return 1;
}

Expand Down Expand Up @@ -2218,14 +2218,15 @@ set_compile_date (void)
{
static int sde_todo = 0;
if (sde_todo == 0) {
char *s = getenv ("SOURCE_DATE_EPOCH");
unsigned char *s = (unsigned char *) getenv ("SOURCE_DATE_EPOCH");
sde_todo = 1;
if (s && *s) {
if (cob_set_date_from_epoch (&current_compile_time, s) == 0) {
set_compile_date_tm ();
return;
}
cobc_err_msg (_("environment variable '%s' has invalid content"), "SOURCE_DATE_EPOCH");
cobc_err_msg (_("environment variable '%s' has invalid content"),
"SOURCE_DATE_EPOCH");
if (!cb_flag_syntax_only) {
cb_source_file = NULL;
cobc_abort_terminate (0);
Expand Down Expand Up @@ -4372,7 +4373,7 @@ process_filename (const char *filename)
#endif
}

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

Expand Down Expand Up @@ -5424,7 +5425,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 @@ -5450,7 +5451,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 @@ -5555,8 +5557,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 {
/* ...stilll output definitions for TYPEDEF / SAME AS */
got_picture = set_picture (top, picture, picture_len);
}
} else {
Expand Down
Loading

0 comments on commit 1992539

Please sign in to comment.