Skip to content

Commit

Permalink
Merged revisions 4964-4978, 4980, 4982-4984, 4986, 4988, 4989, 4992, …
Browse files Browse the repository at this point in the history
…4994-4996, 5003, 5004, 5330 from branches/gnucobol-3.x:

........
Minor adjustments (testsuite, ChangeLog entries, C89)
........
assorted runtime fixes:

libcob:
* common.c (cob_check_beyond_exit), common.h: fix prototype to match strings
* numeric.c (cob_decimal_get_packed): removed code for "huge packed" fields as we don't have packed fields with more than 38 digits
* move.c (cob_get_s64_pic9) [COB_EBCDIC_MACHINE]: fix negative sign lookup
........
assorted compiler fixes

* codegen.c (output_initial_values): drop wrong init comment
* field.c (copy_into_field): set EXTERNAL name if missing
* pplex.l, scanner.l: dropped extra line breaks before area_a token
* pplex.l (ppinput):
  * insert "preparse area_a token" in column 1 instead of column 2 to fix terminal-format support
  * insert it before newlines are added to the beginning of the buffer
........
minor cleanup libcob

libcob:
* intrinsic.c, numeric.c: explicit check result of mpz_sgn to 0/!0/1/-1 using const where possible
* intrinsic.c (cob_intr_random): fix binary end for implicit seed
* intrinsic.c (numval): minor optimization for invalid numeric
........
Support EBCDIC symbolic characters in alphanumeric literals for GCOS

* Support EBCDIC symbolic characters in alphanumeric literals
* Do not error upon symbolic EBCDIC characters in literals for non-GCOS dialects
* Honor -febcdic-table when decoding symbolic EBCDIC characters
........
Move syntax checks on literals to a new file syn_literals.at
........
assorted minor compiler fixes

cobc:
* codegen.c, flag.def [COBC_HAS_CUTOFF_FLAG]:
  * fix compile errors
  * output -fif-cutoff to help when available

config/rm-strict.conf: enable indirect-redefines as this was added with later RM-COBOL versions

configure.ac: minor adjustment for bdb library lookup
........
Refactor read_literal to use an enum for type

In cobc/scanner.l (read_literal): refactor to use `enum cb_literal_type` instead of a char* for the type of literal
........
Allow REPLACE between Gcos `CONTROL DIVISION` and the`IDENTIFICATION DIVISION`
........
gcos.words: remove alias VALUES=VALUE, to correctly parse "VALUES ARE"
........
back to 3.2-dev for this branch
........
GnuCOBOL 3.2 release candidate 2 - 20230210
........
configure.ac, NEWS: updated for 3.2rc-2

update translation files (fr, tr) from TP
........
minor compiler adjustment

cobc.c:
* field.c (cb_build_field_tree), tree.h, parser.y: pass level number as integer, not as cb_tree
* cobc.c (clean_up_intermediates): fix missing move of temporary files when --save-temps=dir is used in combination with -g
........
build environment fixes

configure.ac: fixed adjusted hack for AIX 64bit OBJECT_MODE and added 32bit pendant
........
portability and warning fixes

cobc:
* typeck.c (validate_alphabet): slightly rewritten to fix compiler warnings
* config.c, pparse.y (ppp_replace_list_add), reserved.c (is_invalid_word), tree.c, tree.h, typeck.c: minor adjustments to fix compiler warnings
* field.c (validate_multi_value, validate_elem_value), parser.y (setup_external_definition): fixed analyzer warnings by switching "for" (hint at "possibly NULL" at start) to "while"

libcob:
* intrinsic.c (split_around_t): explicit terminate snprintf
* termio.c (pretty_display_numeric): fix GCC warning with {{ 0 }}
* termio.c (display_alnum_dump): slightly rewritten to fix compiler warnings
* cconv.c (cob_load_collation), common.c, intrinisic.c (cob_intr_random), termio.c: minor adjustments to fix compiler warnings
........
build update for json-c 

configure.ac: search for json-c header in its common default directory json-c/json.h
libcob: handle new define HAVE_JSON_C_JSON_H
........
improving performance for PACKED-DECIMAL, BINARY, DISPLAY conversions from/to integer, also fixing sign regression for PACKED-DECIMAL from [r4967]

libcob:
* numeric.c (cob_decimal_get_packed, cob_decimal_get_display): fix use of mpz_cmp to compare >= 0 (also fixing use on MPIR)
* numeric.c (cob_set_packed_int): fix negative sign
* move.c (packed_get_long_long): fixed sign regression introduced [r4967]
* move.c (cob_get_int, cob_get_llint): handle negative scale for binary fields
* move.c (own_byte_memcpy): removed and replaced replaced by memcpy
* move.c (cob_packed_get_sign): removed, inlined code in callers
* move.c (cob_decimal_get_display): rewritten
* move.c (store_common_region): requesting use of registers
* move.c (cob_move_packed_to_display): rewritten for performance
* move.c (cob_move): prevent conversion to and from cob_decimal for unscaled COB_TYPE_NUMERIC_PACKED, by directly write from integer to packed using (cob_set_packed_int)
* move.c (packed_get_long_long): performance improvements
* move.c (cob_packed_get_int): minor performance improvements
* move.c (packed_get_long_long, display_get_long_long): dropped "cob_" prefix as those are local-only functions

heavily extended testsuite for PACKED-DECIMAL
........
several fixes and minor additions

cobc:
* field.c (copy_into_field, copy_into_field_recursive): fix missing set of flag_is_pointer, fixing TYPEDEF + SAME AS with pointer types
* parser.y, reserved.c: add DISPLAY-1 as PENDING, actually pass NATIONAL usage if specified
* field.c (compute_size), tree.c (cb_tree_type): handle CB_USAGE_NATIONAL
* parser.y, reserved.c: add DATA-POINTER and FUNCTION-POINTER as PENDING
* cobc.c (set_picture): output pointer-type in listing if specified
* parser.y (rep_name_list): fixed error handling loop
* cobc.c (rep_name_list): elide PICTURE string in symbol listing when too long (also fixing a possible SIGSEGV on WIN32)
* cobc.h: fixed prototype for cobc_set_listing_header_code, cobc_get_margin_a, cobc_get_margin_b
* cobc.c: remove trailing slash from -I and -L as those break some  tab-completed command lines and -MD generation
* cobc.c [_WIN32, __DJFPP__]: replace forward slash to backslash for -I fixing -MD generation on mingws/msys environments
* pplex.l (ppcopy_find_file, ppcopy): replace slash to match system and always place name in buffer to allow this
........
missing testcase adjustment for msgid change in r4970
........
let testsuite work better outside of GNU/Linux with GCC environment

tests/testsuite.src/run_misc.at: fix linking/dlopen issue happening on some systems (mostly win32) in test CALL RETURNING POINTER
........
fix cygwin and win32 false-positives in the testsuite via its setup

tests:
* atlocal.in, atlocal_valgrind, atlocal_win: do not unset OS as this is an external var we need to keep for win32
* atlocal_valgrind, atlocal_win: added notes for things we explicit don't want to do

build/aux:
* pre-inst-env.in: export COB_ON_CYGWIN for testsuite checks
........
cleanup of some checks and fixing some msgids, removing unnecessary ones

cobc:
* help.c (cobc_print_usage): fixed msgid to match bin/cobcrun.c
* flag.def: use correct option names in help output
* config.def: fixed typos and spacing in msgids
* flag.def: removed duplicated msgid - those are printed in help.c only
* typeck.c (cb_emit_goto_entry), tree.h, parser.y: dropped duplicated function and msgid, using cb_emit_goto instead
* parser.y (_goto_depending), typeck.c (cb_emit_goto): check via use of numeric_identifier in the parser instead of postponed checking
* parser.y (assign_clause),  typeck.c (cb_check_numeric_value, cb_validate_collating, validate_assign_name, cb_check_integer_value, error_if_not_int_field_or_has_pic_p): dropped very similar msgids using standard ones for the checks
* tree.c (get_category_from_arguments, get_number_in_parentheses): msgid related changes
* 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

libcob:
* call.c (cob_put_s64_param, cob_put_u64_param): switched to common msgid
* common.c (cob_sys_getopt_long_long): lower-case msgid
........
Small cleanup of the testsuite macros syntax
........
[feature-requests:#45] autodetection of fixed/free source format

In cobc:
* cobc.c (main): initialize cb_config_text_column to 72 to avoid a race condition in config files.
* pplex.l (ppopen): try to autodetect the format of a file after checking the BOM of a file
* pplex.l (cobc_set_source_format): add new format name "AUTO" to activate auto-detection of file format
........
more work on packed/decimal performance

cobc/codeoptim.c: adjusted inline functions (cob_cmp_packed_int, cob_get_packed_int) to use register types and less intermediate values

libcob:
* numeric.c
  * (cob_packed_get_sign): move check for COB_FIELD_NO_SIGN_NIBBLE to callers, minor refactoring
  * (cob_decimal_set_packed, cob_decimal_set_display): minor performance improvements
  * (cob_decimal_get_packed, cob_decimal_get_display): rewritten to use local buffer and remainder instead of allocating huge string to just peak at the end
* common.c (cob_move_packed_to_display, cob_packed_get_int, cob_packed_get_long_long): minor performance improvements and similar code to numeric.c
* intrinisic.c (calculate_start_end_for_numval): only skip leading spaces and zeros, but not leading low-values

additional: more testsuite cleanup using explicit escaping and less shell code outside of AT_CHECK, partial after Fabrice Le Fessant
........
fixed old trace to be "as expected" in the testsuite (which may was wrong, later check needed)
........
cobc/cobc.c (process_command_line): output ignored -I and -L options when running verbose
........
cobc:
* codegen.c: generate field offsets and indexes as long long to fix overflow in (actually unsupported) access to huge tables
* cobc.c (process_env_copy_path): changed to do getenv itself and to output ignored entries when running verbose
........
  • Loading branch information
ddeclerck committed Sep 20, 2024
1 parent cf02723 commit 8706d4e
Show file tree
Hide file tree
Showing 78 changed files with 4,475 additions and 2,759 deletions.
25 changes: 24 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,12 +1,35 @@

2024-09-19 David Declerck <[email protected]>

* configure.ac: replace AC_ARG_VAR by AC_SUBST where appropriate

2023-02-25 Ron Norman <[email protected]>

* configure.ac: Add check for sys/time.h
* configure.ac: Add check for sys/time.h

2023-02-19 Simon Sobisch <[email protected]>

* configure.ac: minor adjustment for bdb library lookup

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

* configure.ac: fixed adjusted hack for AIX 64bit OBJECT_MODE
and added 32bit pendant
* configure.ac, NEWS: updated for 3.2rc-2

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

* configure.ac: : search for json-c header in its common
default directory json-c/json.h

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

* configure.ac, NEWS, gnucobol.spec: updated for 3.2rc-1

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

* configure.ac: adjusted hack for AIX 64bit OBJECT_MODE

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

* configure.ac: fix to use pdcurses when libcurses was verified
Expand Down
17 changes: 14 additions & 3 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@ Open Plans:
be reported and recovered from. This is configurable with option
`missing-period`.

If not specified, the compiler tries to automatically recognize the format,
using either fixed or free, depending on column 7 in the first non-space
line. This feature can be disabled by setting the format manually
with `-free`, `-fixed` or `-fformat`.

** the new -febcdic-table option enables one to specify the
translation table used when dealing with EBCDIC codeset;
these translation tables are stored as new configuration files with
Expand Down Expand Up @@ -324,9 +329,13 @@ Open Plans:
** the option -g does not 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
DIVISION, enabling to inspect the initial VALUE setting as well as
"list"ing those copybooks with a source level debugger

** new flag -fstack-extended (implied with --debug and --dump) to include
the origin of entrypoints and PERFORM, this is used for the internal
stack trace on abort and can be used for source level debugging
stack trace on abort and can be used for improved source level debugging

** new options to ensure structured code-flow:
-fsection-exit-check to ensure sections don't "fall through" (are always
Expand Down Expand Up @@ -445,12 +454,14 @@ Open Plans:
as well as during debugging were extended, for example each executed WHEN,
VARYING and UNTIL phrases are now seen

** condition-names are made available for source-level debugging

** cobc's parsing time was significantly reduced for big programs

** execution times were significantly reduced for the following:
INSPECT that use big COBOL fields (multiple KB)
MOVE and comparisions (especially with enabled runtime checks, to
optimize those a re-compile is needed)
MOVE and comparisions in general (especially with enabled runtime
checks, to optimize those a re-compile is needed)
CALL data-item, and first time for each CALL
ACCEPT DATE/TIME/DAY, most if numeric items are accepted
datetime related FUNCTIONs
Expand Down
4 changes: 4 additions & 0 deletions build_aux/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

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

* pre-inst-env.in: export COB_ON_CYGWIN for testsuite checks

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

* pre-inst-env.in: prefer config.status replacement over environment var
Expand Down
7 changes: 7 additions & 0 deletions build_aux/pre-inst-env.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ export COB_CONFIG_DIR COB_COPY_DIR
export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH
export COB_LIBRARY_PATH

# ensure we don't execute windows paths within programs generated by cygwin
# by passing a hint
if test "$OSTYPE" = "cygwin"; then
COB_ON_CYGWIN=1
export COB_ON_CYGWIN
fi

# not robust check, but better than none
if test "x${BASH_SOURCE}" != "x" -a "${BASH_SOURCE}" != "$0"; then
echo "This script should not be sourced but called instead!"
Expand Down
17 changes: 10 additions & 7 deletions build_windows/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,16 @@
/* #undef HAVE_ISFINITE */
#endif

/* Define to 1 if you have the <json-c/json.h> header file. */
#if CONFIGURED_JSON == JSON_C
#define HAVE_JSON_C_JSON_H 1
#else
/* #undef HAVE_JSON_C_JSON_H */
#endif

/* Define to 1 if you have the <json.h> header file. */
/* #undef HAVE_JSON_H */

/* Define to 1 if you have the <isintstd.h> header file. */
#if CONFIGURED_ISAM == DISAM
#define HAVE_ISINTSTD_H 1
Expand Down Expand Up @@ -789,13 +799,6 @@
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1

/* Define to 1 if you have the <sys/wait.h> header file. */
#if defined(__ORANGEC__)
#define HAVE_SYS_WAIT_H 1
#else
/* #undef HAVE_SYS_WAIT_H */
#endif

/* Has timezone variable */
/* note: MSC and ORANGEC have it as _timezone */
#define HAVE_TIMEZONE 1
Expand Down
130 changes: 122 additions & 8 deletions cobc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
* typeck.c (cb_emit, cb_emit_list): changed from defines to inline
functions, now returning the tree that was emitted

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

* error.c, cobc.c (print_program_trailer), flag.def:
implemented -fmax-errors=0 as unlimited

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

* tree.h (cb_file), parser.y: organization and access_mode as enums
Expand All @@ -40,6 +45,35 @@
* typeck.c: Check for small integer for add/subtruct and use
cob_add_int/cob_sub_int as the speed in this case was improved

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

* codegen.c (output_initial_values): drop wrong init comment
* field.c (copy_into_field): set EXTERNAL name if missing
* pplex.l, scanner.l: dropped extra line breaks before area_a token
* pplex.l (ppinput): insert "preparse area_a token" in column 1 instead
of column 2 to fix terminal-format support and insert it before
newlines are added to the beginning of the buffer

2023-02-21 Simon Sobisch <[email protected]>

* codegen.c, flag.def [COBC_HAS_CUTOFF_FLAG]: fix compile errors,
output -fif-cutoff to help when available

2023-02-20 Nicolas Berthier <[email protected]>

* scanner.l, config.def: Add support for EBCDIC symbolic characters in
alphanumeric literals, which is a GCOS-specific extension; add new
configuration option ebcdic-symbolic-characters
* scanner.l, pplex.l: detect and issue a warning when EBCDIC
symbolic character strings include extraneous separators

2023-02-20 Fabrice Le Fessant <[email protected]>

* scanner.l (read_literal): refactor to use enum cb_literal_type
instead of a char* for the type of literal
* pplex.l: allow REPLACE between Gcos CONTROL DIVISION and
the IDENTIFICATION DIVISION

2023-02-19 Ron Norman <[email protected]>

* cobc.c,cobc.h: Added cb_max_binary to hold max digits allowed in binary
Expand All @@ -49,7 +83,76 @@
* tree.c: Change to use cb_max_binary instead of constant
* typeck.c: Change to use cb_max_binary instead of constant

2023-01-23 David Declerck <[email protected]>
2023-02-10 Simon Sobisch <[email protected]>

* cobc.c (clean_up_intermediates): fix missing move of temporary files
when --save-temps=dir is used in combination with -g
* field.c (cb_build_field_tree), tree.h, parser.y: pass level number as
integer, not as cb_tree

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

* typeck.c (validate_alphabet): slightly rewritten to fix compiler warnings
* config.c, pparse.y (ppp_replace_list_add), reserved.c (is_invalid_word),
tree.c, tree.h, typeck.c: minor adjustments to fix compiler warnings
* field.c (validate_multi_value, validate_elem_value),
parser.y (setup_external_definition): fixed analyzer warnings by switching
"for" (hint at "possibly NULL" at start) to "while"

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

* cobc.c (rep_name_list): elide PICTURE string in symbol listing
when too long (also fixing a possible SIGSEGV on WIN32)
* cobc.h: fixed prototype for cobc_set_listing_header_code,
cobc_get_margin_a, cobc_get_margin_b
* cobc.c: remove trailing slash from -I and -L as those break some
tab-completed command lines and -MD generation
* cobc.c [_WIN32, DOS]: replace forward slash to backslash for -I
fixing -MD generation on mingws/msys environments
* pplex.l (ppcopy_find_file, ppcopy): replace slash to match system and
always place name in buffer to allow this

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

* parser.y (rep_name_list): fixed error handling loop

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

* field.c (copy_into_field, copy_into_field_recursive): fix missing set
of flag_is_pointer, fixing TYPEDEF + SAME AS with pointer types
* parser.y, reserved.c: add DISPLAY-1 as PENDING,
actually pass NATIONAL usage if specified
* field.c (compute_size), tree.c (cb_tree_type): handle CB_USAGE_NATIONAL
* parser.y, reserved.c: add DATA-POINTER and FUNCTION-POINTER as PENDING
* cobc.c (set_picture): output pointer-type in listing if specified
* 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

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

* codeoptim.c: adjusted inline functions (cob_cmp_packed_int,
cob_get_packed_int) to use register types and less intermediate values

2023-01-28 Fabrice Le Fessant <[email protected]>

* cobc.c (main): initialize cb_config_text_column to 72 to avoid a
race condition in config files.
* pplex.l (ppopen): try to autodetect the format of a file after
checking the BOM of a file
* pplex.l (cobc_set_source_format): add new format name "AUTO" to
activate auto-detection of file format

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

* codegen.c: generate field offsets and indexes as long long to
fix overflow in (actually unsupported) access to huge tables
* cobc.c (process_env_copy_path): changed to do getenv itself and
to output ignored entries when running verbose
* cobc.c (process_command_line): output ignored -I and -L options
when running verbose

2023-01-23 David Declerck <[email protected]>

FR #429: option to specify conversion table via translation table file
* cobc.c, flag.def, cobc.h: handle external table for "ebcdic-table"
Expand All @@ -69,6 +172,23 @@
out of bounds
* codeoptim.c: Fix cob_check_subscript_inline for min subscript value

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

* help.c (cobc_print_usage): fixed msgid to match bin/cobcrun.c
* flag.def: use correct option names in help output
* config.def: fixed typos and spacing in msgids
* flag.def: removed duplicated msgid - those are printed in help.c only
* typeck.c (cb_emit_goto_entry), tree.h, parser.y: dropped duplicated
function and msgid, using cb_emit_goto instead
* parser.y (_goto_depending), typeck.c (cb_emit_goto): check via use of
numeric_identifier in the parser instead of postponed checking
* parser.y (assign_clause), typeck.c (cb_check_numeric_value,
cb_validate_collating, validate_assign_name,
cb_check_integer_value, error_if_not_int_field_or_has_pic_p):
dropped very similar msgids using standard ones for the checks
* tree.c (get_category_from_arguments, get_number_in_parentheses): msgid
related changes

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

* parser.y (cb_default_colseq, build_default_colseq, setup_default_colseq):
Expand Down Expand Up @@ -596,7 +716,7 @@
FR #360 AREACHECK
FR #309 raise warnings/errors when some periods are missing
* config.def: add dialect options areacheck and missing-period
* pplex.l, scanner.l, parser.y: check for empty Area A, and use a
* pplex.l, scanner.l, parser.y: check for empty Area A, and use a set of
dedicated *_IN_AREA_A tokens to detect missing periods and incorrect
use of Area A
* pplex.l, scanner.l, parser.y: support AREACHECK and NOAREACHECK
Expand Down Expand Up @@ -7413,12 +7533,6 @@

* Report Writer module

201?-??-?? Sergey Kashyrin <[email protected]>

* codeoptim.c : Fixed bug in COB_ADD_PACKED_INT.
Computing COMP-3 failed in MSVC-build versions,
in output_storage() calls '%' should be '%%'.

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

* cobc.c: Added conversion for enabling options in WIN style
Expand Down
Loading

0 comments on commit 8706d4e

Please sign in to comment.