Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI for forward-porting GC3 patches to GC4 #147

Draft
wants to merge 15 commits into
base: gc4
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,24 @@

* configure.ac: replace AC_ARG_VAR by AC_SUBST where appropriate

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

* configure.ac: fix for resolving COBCRUN_NAME

2024-05-14 David Declerck <[email protected]>

* configure.ac: update flags for building dynamic libraries on macOS
(helps fixing testsuite issues on recent macOS versions)

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

* configure.ac: add -fstack-clash-protection to --enable-hardening[=no]

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

* configure.ac, NEWS: updated for 3.2
* configure.ac: check for mousemask and mmask_t

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

* configure.ac: fix for resolving COBCRUN_NAME

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

* configure.ac: added test for HAVE_RESIZE_TERM function
Expand Down Expand Up @@ -1682,7 +1691,7 @@
* Version 0.9 released.


Copyright 2002-2023 Free Software Foundation, Inc.
Copyright 2002-2024 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.
36 changes: 34 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,39 @@ Open Plans:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

GnuCOBOL 3.2
GnuCOBOL 3.3 (planned January 2023)

work in progress

* New GnuCOBOL features

** 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

* 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)
GnuCOBOL 3.2rc1 (20230118)
GnuCOBOL 3.2rc2 (20230210)

* New GnuCOBOL features

Expand Down Expand Up @@ -436,7 +468,7 @@ Open Plans:

** the -P flag accepts - as argument for stdout

* Important Bugfixes:
* Important Bugfixes

** for dialects other than the GnuCOBOL default different reserved "alias" words
were not usable, for example SYNCHRONIZED or COMPUTATIONAL. This was fixed
Expand Down
10 changes: 10 additions & 0 deletions build_windows/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,9 @@
/* #undef HAVE_ATTRIBUTE_CONSTRUCTOR - using DllMain */
#endif

/* Has __attribute__((pure)) */
/* #undef HAVE_ATTRIBUTE_PURE */

/* Define to 1 if you have the `canonicalize_file_name' function. */
#if defined(__ORANGEC__)
#define HAVE_CANONICALIZE_FILE_NAME 1
Expand Down Expand Up @@ -659,6 +662,13 @@
/* #undef HAVE_MOUSEINTERVAL */
#endif

/* curses has mousemask function and mmask_t definition */
#if CONFIGURED_CURSES != NOCURSES
#define HAVE_MOUSEMASK 1
#else
/* #undef HAVE_MOUSEMASK */
#endif

/* Define to 1 if you have the <mpir.h> header file. */
#if USED_MATHLIB == MATHLIB_MPIR
#define HAVE_MPIR_H 1
Expand Down
42 changes: 42 additions & 0 deletions cobc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,52 @@
* typeck.c (cb_emit, cb_emit_list): changed from defines to inline
functions, now returning the tree that was emitted

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]>

Expand Down
20 changes: 15 additions & 5 deletions cobc/cobc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2256,25 +2256,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 @@ -3284,6 +3290,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 'G':
Expand Down
2 changes: 2 additions & 0 deletions cobc/cobc.h
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,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
33 changes: 16 additions & 17 deletions cobc/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ struct attr_list {
struct literal_list {
struct literal_list *next;
struct cb_literal *literal;
cb_tree x;
int id;
int make_decimal;
};
Expand Down Expand Up @@ -720,7 +719,12 @@ output_string (const unsigned char *s, const int size, const cob_u32_t llit)
} else
#endif
if (!isprint (c)) {
#if 1 /* octal */
output ("\\%03o", c);
#else /* hex (can be useful for a small amount of non-printable characters,
but gets really uggly if the string has a lot of those */
output ("\" \"\\x%X\" \"", c);
#endif
} else if (c == '\"') {
output ("\\%c", c);
} else if ((c == '\\' || c == '?') && !llit) {
Expand Down Expand Up @@ -825,18 +829,17 @@ chk_field_variable_address (struct cb_field *fld)
if (!cb_odoslide)
return 0;
if (!fld->flag_vaddr_done) {
/* Note: this is called _very_ often and takes 15-20% of parse + codegen time,
/* Note: this was called _very_ often and took 15-20% of parse + codegen time,
with about half the time in chk_field_variable_size; so try to not call
this function if not necessary (according to the testsuite: as long as
cb_odoslide is not set, but the caller's coverage is not that well...) */
struct cb_field *f = fld;
struct cb_field *p;
for (p = f->parent; p; f = f->parent, p = f->parent) {
for (p = p->children; p != f; p = p->sister) {
/* Skip PIC L fields as their representation
have constant length */
if (p->depending ||
(!p->flag_picture_l && chk_field_variable_size (p))) {
if (p->depending /* ODO leads to variable size */
|| (!p->flag_picture_l && chk_field_variable_size (p)) /* skipping PIC L fields */
) {
fld->flag_vaddr_done = 1;
fld->vaddr = 1;
return 1;
Expand Down Expand Up @@ -3177,7 +3180,7 @@ output_literals_figuratives_and_constants (void)
for (lit = literal_cache; lit; lit = lit->next) {
output ("static const cob_field %s%d\t= ",
CB_PREFIX_CONST, lit->id);
output_field (lit->x);
output_field (CB_TREE(lit->literal));
output (";");
output_newline ();
}
Expand Down Expand Up @@ -3379,7 +3382,6 @@ cb_lookup_literal (cb_tree x, int make_decimal)
l->id = cb_literal_id;
l->literal = literal;
l->make_decimal = make_decimal;
l->x = x;
l->next = literal_cache;
literal_cache = l;

Expand Down Expand Up @@ -5579,8 +5581,8 @@ output_initialize_uniform (cb_tree x, struct cb_field *f,
output_size (x);
output (");");
} else if (!gen_init_working
&& (f->flag_unbounded || !(cb_complex_odo || cb_odoslide))
&& chk_field_variable_size (f) != NULL) {
&& (f->flag_unbounded || !(cb_complex_odo || cb_odoslide))
&& chk_field_variable_size (f) != NULL) {
out_odoslide_size (f);
output (");");
} else {
Expand Down Expand Up @@ -13568,7 +13570,7 @@ output_internal_function (struct cb_program *prog, cb_tree parameter_list)
/* Check matching version */
#if !defined (HAVE_ATTRIBUTE_CONSTRUCTOR)
#ifdef _WIN32
if (prog->flag_main) /* otherwise we generate that in DllMain*/
if (prog->flag_main) /* otherwise we generate that in DllMain */
#else
if (!prog->nested_level)
#endif
Expand Down Expand Up @@ -13667,8 +13669,7 @@ output_internal_function (struct cb_program *prog, cb_tree parameter_list)

seen = 0;
for (m = literal_cache; m; m = m->next) {
if (CB_TREE_CLASS (m->x) == CB_CLASS_NUMERIC
&& m->make_decimal) {
if (m->make_decimal) {
if (!seen) {
seen = 1;
output_line ("/* Set Decimal Constant values */");
Expand Down Expand Up @@ -13887,8 +13888,7 @@ output_internal_function (struct cb_program *prog, cb_tree parameter_list)
output_line ("P_clear_decimal:");
seen = 0;
for (m = literal_cache; m; m = m->next) {
if (CB_TREE_CLASS (m->x) == CB_CLASS_NUMERIC
&& m->make_decimal) {
if (m->make_decimal) {
if (!seen) {
seen = 1;
output_line ("/* Clear Decimal Constant values */");
Expand Down Expand Up @@ -14972,8 +14972,7 @@ codegen_finalize (void)
struct literal_list* m;
int comment_gen = 0;
for (m = literal_cache; m; m = m->next) {
if (CB_TREE_CLASS (m->x) == CB_CLASS_NUMERIC
&& m->make_decimal) {
if (m->make_decimal) {
if (!comment_gen) {
comment_gen = 1;
output_storage ("\n/* Decimal constants */\n");
Expand Down
Loading
Loading