Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/gnucobol-3.x' into gcos4gnucob…
Browse files Browse the repository at this point in the history
…ol-3.x
  • Loading branch information
ddeclerck committed Jan 22, 2024
2 parents 98a5c78 + 5d0eecf commit f059c84
Show file tree
Hide file tree
Showing 41 changed files with 1,552 additions and 605 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

2023-10-17 David Declerck <[email protected]>

* configure.ac: add checks to allow using stdint.h and inttypes.h

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

* configure.ac: add -fstack-clash-protection to --enable-hardening[=no]
Expand Down
21 changes: 19 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,16 +1,33 @@
NEWS - user visible changes -*- outline -*-

GnuCOBOL 3.3 (planned December 2023)
GnuCOBOL 3.3 (planned January 2023)

work in progress

* New GnuCOBOL features

work in progress
** cobc now checks for binary files and early exit parsing those;
the error output for format errors (for example invalid indicator column)
is now limitted to 5 per source file

more work in progress

* Important Bugfixes

** #904: MOVE PACKED-DECIMAL unsigned to signed led to bad sign
** #918: COB_LS_VALIDATE (io status 09 and 71) partial broken

* Changes to the COBOL compiler (cobc) options:

** output of unlimited errors may be requested by -fmax-errors=0,
to stop compiliation at first error use -Wfatal-errors
** default value for -fmax-errors was changed from 128 to 20

* More notable changes

** execution times were significantly reduced for the following:
INSPECT CONVERTING (and "simple" INSPECT REPLACING), in general
and especially if both from and to are constants


GnuCOBOL 3.2 (20230728)
Expand Down
70 changes: 70 additions & 0 deletions cobc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,74 @@

2023-10-17 David Declerck <[email protected]>

BUG #923: generated modules init/clear unused decimal constants
* codegen.c (literal_list): removal of the unused x field,
and type moved to tree.h
* tree.h (struct cb_program): new decimal_constant field
to store decimal constants used by the current program,
* codegen.c (cb_cache_program_decimal_constant): new function
that adds constants used by the current program to the new
decimal_constant field in struct cb_prog
* codegen.c (cb_lookup_literal): added the current program as
argument to cb_lookup_literal to account for different
usage contexts (parse/typecheck vs codegen)
* codegen.c (output_internal_function): iterate over
prog->decimal_constants instead of literal_cache so as to only
output decimal constants actually used by the current program
* typeck.c (decimal_expand, cb_build_cond_fields),
codegen.c (output_param) : pass current_program to cb_lookup_literal

BUG #917: segfault on decimal constant after CANCEL on subprogram
* codegen.c (codegen_internal, codegen_finalize): move declaration
of decimal constants from global storage to local storage

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

* codegen.c (literal_list): removed self-reference as tree
* replace.c (ppecho_replace): now inline
* replace.c (cb_free_replace): removed setting child to zero before free
* replace.c: style adjustment

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

* typeck.c (cb_build_converting): protoype (disabled) to pre-generate
conversion table and call new function cob_inspect_translating instead
of cob_inspect_converting if both operands are literals/alphabets

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

* typeck.c (validate_inspect): check for identical operands,
check for invalid combination of operands
* typeck.c (cb_build_converting): shortcut when identical operands
are used
* tree.h: change alphabet_target and alphabet_type from defines to enums

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

* pplex.l (ppopen_get_file): test for binary file and directly error out
* cobc.c (cobc_terminate_exit), cobc.h: split cobc_terminate and make
the new function available
* pplex.l: check for format errors per file and skip format related
warnings if the file reached a max. of 5 such errors
* error.c, cobc.c (print_program_trailer), flag.def:
implemented -fmax-errors=0 as unlimited
* flag.def (max_errors): reduced default from 128 to 20
* config.c (cb_load_conf), error.c (configuration_error): count missing
definitions as single error
* cobc.c (process_command_line): passing -O0 by defaut for -g as some
C compilers raise warnings otherwise, breaking the testsuite

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

* codeoptim.c (cob_gen_optim): fixed to actually skip leading zeros
for COB_GET_NUMDISP and COB_GET_NUMDISPS

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

* typeck.c (emit_definition_note): renamed from warning_destination
* typeck.c (emit_definition_note), tree.h (cb_field): prevent output
of the same field multiple times by new flag_had_definition_note

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

* typeck.c (search_set_keys): improving SEARCH ALL syntax checks
Expand Down
24 changes: 17 additions & 7 deletions cobc/cobc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2354,25 +2354,31 @@ set_listing_date (void)
LISTING_TIMESTAMP_FORMAT, &current_compile_tm);
}


DECLNORET static void COB_A_NORETURN
cobc_terminate (const char *str)
void
cobc_terminate_exit (const char *filename, const char *error)
{
if (cb_src_list_file) {
set_listing_date ();
set_standard_title ();
cb_listing_linecount = cb_lines_per_page;
cobc_elided_strcpy (cb_listing_filename, str, sizeof (cb_listing_filename), 0);
cobc_elided_strcpy (cb_listing_filename, filename, sizeof (cb_listing_filename), 0);
print_program_header ();
}
cb_perror (0, "cobc: %s: %s", str, cb_get_strerror ());
cb_source_line = 0; /* no context output for fatal open input/output errors */
cb_perror (0, "cobc: %s: %s", filename, error);
if (cb_src_list_file) {
print_program_trailer ();
}
cobc_clean_up (1);
exit (EXIT_FAILURE);
}

DECLNORET static void COB_A_NORETURN
cobc_terminate (const char *filename)
{
cobc_terminate_exit (filename, cb_get_strerror ());
}

static void
cobc_abort_msg (void)
{
Expand Down Expand Up @@ -3259,6 +3265,10 @@ process_command_line (const int argc, char **argv)
#ifdef COB_DEBUG_FLAGS
COBC_ADD_STR (cobc_cflags, " ", cobc_debug_flags, NULL);
#endif
if (copt == NULL) {
/* some compilers warn if not explicit passed, so default to -O0 for -g */
copt = CB_COPT_0;
}
break;

case 'd':
Expand Down Expand Up @@ -6408,10 +6418,10 @@ print_program_trailer (void)
print_program_data (print_data);
break;
}
if (errorcount > cb_max_errors) {
if (cb_max_errors && errorcount > cb_max_errors) {
snprintf (print_data, CB_PRINT_LEN,
_("Too many errors in compilation group: %d maximum errors"),
cb_max_errors);
cb_max_errors != -1 ? cb_max_errors : 0);
print_program_data (print_data);
}
force_new_page_for_next_line ();
Expand Down
2 changes: 2 additions & 0 deletions cobc/cobc.h
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,8 @@ extern void cb_add_error_to_listing (const char *, int, const char *, char *);
DECLNORET extern void flex_fatal_error (const char *, const char *,
const int) COB_A_NORETURN;

DECLNORET extern void cobc_terminate_exit (const char *, const char *) COB_A_NORETURN;

extern void cobc_set_listing_header_code (void);

/* reserved.c */
Expand Down
Loading

0 comments on commit f059c84

Please sign in to comment.