Skip to content

Commit

Permalink
assorted updates
Browse files Browse the repository at this point in the history
configure.ac:
* drop COB_LI_IS_LL in favor of existing COB_32_BIT_LONG
* (cjson=local): use CJSON_CFLAGS and CJSON_LIBS also for this case, fix include not to use quotes

cobc:
* cobc.c (cobc_print_info): drop COB_LI_IS_LL in favor of existing COB_32_BIT_LONG
* typeck.c (cb_tree_list_has_numeric_ref_or_field): cleanup
* typeck.c (cb_emit_accept): always check position
* cobc.c, flag.def: make scope optional for -fdump

libcob:
* fileio.c (cob_fd_file_open) [_WIN32]: workaround for MinGW bug in locking
* common.h, common.c (cob_cleanup_thread): fix declaration
* common.c: drop includes found in coblocal.h
* common.c (cob_alloc_module): changed type and name of cob_mod_ptr
* common.h, coblocal.h: added pragma once for better supporting clangd in single-file mode
* intrinsic.c: speedup for NUMVAL related functions
  • Loading branch information
sf-mensch committed Sep 29, 2024
1 parent 10daa94 commit 903ba84
Show file tree
Hide file tree
Showing 17 changed files with 145 additions and 97 deletions.
12 changes: 9 additions & 3 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@

2024-09-29 Simon Sobisch <[email protected]>

* configure.ac: drop COB_LI_IS_LL in favor of existing COB_32_BIT_LONG
* configure.ac (cjson=local): use CJSON_CFLAGS and CJSON_LIBS also for
this case, fix include not to use quotes

2024-09-27 Simon Sobisch <[email protected]>

* build_aux/ltmain.sh, m4/libtool.m4, m4/ltoptions.m4, m4/ltversion.m4:
update libtool from 2.46 to 2.53, dropping all manual patches
* configure.ac: require autoconf 2.70 and drop check for lex-library with
* configure.ac: require autoconf 2.70 and drop check for lex-library with
noyywrap option for AC_PROG_LEX
* HACKING: document dependencies autoconf 2.70 and automake 1.16 and
several smaller text updates
* Makefile.am (checkmanual-code-coverage, checkall-code-coverage): new
targets removing the need to do that manually
* build_aux/ltmain.sh, m4/libtool.m4, m4/ltoptions.m4, m4/ltversion.m4:
update libtool from 2.46 to 2.53, dropping all manual patches
* DEPENDENCIES: added perl for running NIST85

2024-09-09 Simon Sobisch <[email protected]>
Expand Down
4 changes: 2 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ vcs-update:
distbin distbin-gzip distbin-bzip2 distbin-lzip distbin-xz

test: all
cd tests && $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) test
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C tests test
checkmanual: all
cd tests && $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) checkmanual
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C tests checkmanual

checkall: check test

Expand Down
4 changes: 0 additions & 4 deletions build_windows/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,6 @@
#define COB_LIBS "libcob.l"
#endif


/* long int is long long */
/* #undef COB_LI_IS_LL */

/* Module extension */
#define COB_MODULE_EXT "dll"

Expand Down
11 changes: 11 additions & 0 deletions cobc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@

2024-09-29 Simon Sobisch <[email protected]>

* cobc.c (cobc_print_info): drop COB_LI_IS_LL
in favor of existing COB_32_BIT_LONG

2024-09-27 Simon Sobisch <[email protected]>

* plex.l, scanner.l: use noyywrap option instead of manually
defining related code parts
* typeck.c (cb_tree_list_has_numeric_ref_or_field): cleanup

2024-09-25 Nicolas Berthier <[email protected]>

Expand All @@ -13,6 +19,11 @@
* typeck.c (cb_emit_move, cb_emit_set_to): do not check for incompatible
data if no receiver field is of category numeric or numeric edited

2024-09-03 Simon Sobisch <[email protected]>

* typeck.c (cb_emit_accept): always check position
* cobc.c, flag.def: make scope optional for -fdump

2024-08-28 David Declerck <[email protected]>

* tree.c (char_to_precedence_idx, get_char_type_description, valid_char_order):
Expand Down
6 changes: 3 additions & 3 deletions cobc/cobc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2704,7 +2704,7 @@ cobc_print_info (void)
cobc_var_print ("64bit-mode", _("no"), 0);
#endif

#ifdef COB_LI_IS_LL
#ifndef COB_32_BIT_LONG
cobc_var_print ("BINARY-C-LONG", _("8 bytes"), 0);
#else
cobc_var_print ("BINARY-C-LONG", _("4 bytes"), 0);
Expand Down Expand Up @@ -2797,7 +2797,7 @@ cobc_def_dump_opts (const char *opt, const int on)
int dump_to_set;
cb_old_trace = 0; /* Use new methods */

if (!cb_strcasecmp (opt, "ALL")) {
if (!opt || !cb_strcasecmp (opt, "ALL")) {
if (on) {
cb_flag_dump = COB_DUMP_ALL;
} else {
Expand Down Expand Up @@ -3287,7 +3287,7 @@ process_command_line (const int argc, char **argv)
break;

case CB_FLAG_GETOPT_DUMP:
/* -fdump=<scope> : Add sections for dump code generation */
/* -fdump[=<scope>] : Add sections for dump code generation */
cobc_def_dump_opts (cob_optarg, 1);
break;

Expand Down
5 changes: 3 additions & 2 deletions cobc/flag.def
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ CB_FLAG_NQ (0, "ec", CB_FLAG_GETOPT_EC,
CB_FLAG_NQ (0, "no-ec", CB_FLAG_GETOPT_NO_EC,
" -fno-ec=<exception-name>\tdisable code generation for <exception-name>")

CB_FLAG_NQ (1, "dump", CB_FLAG_GETOPT_DUMP,
CB_FLAG_OP (1, "dump", CB_FLAG_GETOPT_DUMP,
_(" -fdump=<scope> dump data fields on abort, <scope> may be\n"
" a combination of: ALL, WS, LS, RD, FD, SC, LO"))
" a combination of: ALL, WS, LS, RD, FD, SC, LO\n"
" default if no scope specified: ALL"))
CB_FLAG_OP (0, "no-dump", CB_FLAG_GETOPT_NO_DUMP,
_(" -fno-dump=<scope> exclude data fields from dumping on abort, <scope> may\n"
" be a combination of: ALL, WS, LS, RD, FD, SC, LO\n"
Expand Down
16 changes: 10 additions & 6 deletions cobc/typeck.c
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,8 @@ cb_emit_list (cb_tree l)
}

static COB_INLINE COB_A_INLINE int
cb_tree_is_numeric_ref_or_field (cb_tree x, int include_numeric_edited) {
cb_tree_is_numeric_ref_or_field (cb_tree x, int include_numeric_edited)
{
int cat;
if (!x || !CB_REF_OR_FIELD_P (x)) {
return 0;
Expand All @@ -1067,8 +1068,9 @@ cb_tree_is_numeric_ref_or_field (cb_tree x, int include_numeric_edited) {
}

static int
cb_tree_list_has_numeric_ref_or_field (cb_tree l) {
for (l;
cb_tree_list_has_numeric_ref_or_field (cb_tree l)
{
for (;
l && !cb_tree_is_numeric_ref_or_field (CB_VALUE (l), 1);
l = CB_CHAIN (l));
return (l != NULL);
Expand Down Expand Up @@ -3939,6 +3941,7 @@ validate_alphabet (cb_tree alphabet)
ap->high_val_char = maxchar;

alphabet_valid = 1;
n = 0; /* keep analyzer happy */

for (l = ap->custom_list; l; l = CB_CHAIN (l)) {
x = CB_VALUE (l);
Expand Down Expand Up @@ -8258,7 +8261,9 @@ cb_emit_accept (cb_tree var, cb_tree pos, struct cb_attr_struct *attr_ptr)
if (cb_listing_xref) {
cobc_xref_set_receiving (var);
}

if (cb_validate_one (pos)) {
return;
}
if (attr_ptr) {
fgc = attr_ptr->fgc;
bgc = attr_ptr->bgc;
Expand All @@ -8270,8 +8275,7 @@ cb_emit_accept (cb_tree var, cb_tree pos, struct cb_attr_struct *attr_ptr)
cursor = attr_ptr->cursor;
color = attr_ptr->color;
disp_attrs = attr_ptr->dispattrs;
if (cb_validate_one (pos)
|| cb_validate_one (fgc)
if (cb_validate_one (fgc)
|| cb_validate_one (bgc)
|| cb_validate_one (scroll)
|| cb_validate_one (timeout)
Expand Down
18 changes: 6 additions & 12 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ AH_TEMPLATE([COB_EXE_EXT], [Executable extension])
AH_TEMPLATE([COB_KEYWORD_INLINE], [Keyword for inline])
AH_TEMPLATE([COB_NO_SELFOPEN], [Can not dlopen self])
AH_TEMPLATE([COB_COMPUTED_GOTO], [Compilation of computed gotos works])
AH_TEMPLATE([COB_LI_IS_LL], [long int is long long])
AH_TEMPLATE([COB_32_BIT_LONG], [long int is 32 bits])
AH_TEMPLATE([COB_64_BIT_POINTER], [Pointers are longer than 32 bits])
AH_TEMPLATE([WITH_CURSES], [curses library for extended SCREEN I/O])
Expand Down Expand Up @@ -999,7 +998,7 @@ AS_IF([test "$with_xml2" = yes -o "$with_xml2" = check], [
XML2_LIBS="-lxml2"
fi
LIBS="$LIBS $LIBCOB_LIBS_extern $XML2_LIBS"
# note: PKG_CONFIG and xml2-config set -I /path/to/libxml2 which contains a "libxml" folder where
# note: PKG_CONFIG and xml2-config set -I/path/to/libxml2 which contains a "libxml" folder where
# all the files we look for are included
for header in xmlwriter xmlversion uri parser tree; do
AC_CHECK_HEADER([libxml/$header.h], [],
Expand Down Expand Up @@ -1080,8 +1079,8 @@ AS_IF([test "$USE_JSON" = "cjson" -o "$USE_JSON" = "local" -o "$USE_JSON" = chec
with_cjson_local=no
AS_IF([test -e ./libcob/cJSON.c],
[AC_MSG_CHECKING([whether linking of ./libcob/cJSON.c works])
CPPFLAGS="$curr_cppflags -I./libcob"
LIBS="$LIBS $LIBCOB_LIBS_extern"
CPPFLAGS="$curr_cppflags -I./libcob $CJSON_CFLAGS"
LIBS="$LIBS $LIBCOB_LIBS_extern $CJSON_LIBS"
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[#include "cJSON.c"]],
[[#if (CJSON_VERSION_MAJOR * 100 + CJSON_VERSION_MINOR) < 103
Expand All @@ -1098,8 +1097,8 @@ AS_IF([test "$USE_JSON" = "cjson" -o "$USE_JSON" = "local" -o "$USE_JSON" = chec
if test "$with_cjson_local" = no; then
AS_IF([test -e "$srcdir/libcob/cJSON.c"],
[AC_MSG_CHECKING([whether linking of "$srcdir/libcob/cJSON.c" works])
CPPFLAGS="$curr_cppflags -I\"$srcdir/libcob\""
LIBS="$LIBS $LIBCOB_LIBS_extern"
CPPFLAGS="$curr_cppflags -I$srcdir/libcob $CJSON_CFLAGS"
LIBS="$LIBS $LIBCOB_LIBS_extern $CJSON_LIBS"
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[#include "cJSON.c"]],
[[#if (CJSON_VERSION_MAJOR * 100 + CJSON_VERSION_MINOR) < 103
Expand All @@ -1108,7 +1107,7 @@ AS_IF([test "$USE_JSON" = "cjson" -o "$USE_JSON" = "local" -o "$USE_JSON" = chec
cJSON_CreateNull ();]])],
[AC_MSG_RESULT([yes])
AC_DEFINE([WITH_CJSON], [1])
with_cjson_local="yes (in \"$srcdir/libcob\")"],
with_cjson_local="yes (in $srcdir/libcob)"],
[AC_MSG_RESULT([no])]
)
LIBS="$curr_libs"]
Expand Down Expand Up @@ -1933,11 +1932,6 @@ AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(void *)

AC_MSG_CHECKING([whether size of long int = size of long long])
AS_IF([test "$ac_cv_sizeof_long_int" = "$ac_cv_sizeof_long_long"],
[AC_DEFINE([COB_LI_IS_LL], [1]) AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])

AC_MSG_CHECKING([whether long is 32 bits])
AS_IF([test "$ac_cv_sizeof_long" = 4],
[AC_DEFINE([COB_32_BIT_LONG], [1]) AC_MSG_RESULT([yes])],
Expand Down
44 changes: 32 additions & 12 deletions libcob/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

2024-09-29 Simon Sobisch <[email protected]>

* numeric.c, common.c (print_info_detailed): drop COB_LI_IS_LL
in favor of existing COB_32_BIT_LONG

2024-07-27 Chuck Haatvedt <[email protected]>

* screenio.c: In preparation for Multiple Window support
Expand Down Expand Up @@ -31,6 +36,20 @@
* screenio.c (cob_settings_screenio): implemented runtime config to hide
the cursor

2024-08-11 Simon Sobisch <[email protected]>

* fileio.c (cob_fd_file_open) [_WIN32]: workaround for MinGW bug in locking

2024-08-09 Simon Sobisch <[email protected]>

* common.h, common.c (cob_cleanup_thread): fix declaration
* common.c: drop includes found in coblocal.h
* common.c (cob_alloc_module): changed type and name of cob_mod_ptr

2024-08-06 Simon Sobisch <[email protected]>

* intrinsic.c: speedup for NUMVAL related functions

2024-07-29 Chuck Haatvedt <[email protected]>

* move.c (optimized_move_display_to_edited): fixed small bug
Expand Down Expand Up @@ -84,10 +103,10 @@

2024-05-30 Chuck Haatvedt <[email protected]>

fix errors caught by the Sanitizer functionality of GCC. This
change did not resolve all of the issues found as some of them
were in Berkeley DB and some were intentional in the memory
corruption logic which has been implemented in the runtime.
fix errors caught by the Sanitizer functionality of GCC. This
change did not resolve all of the issues found as some of them
were in Berkeley DB and some were intentional in the memory
corruption logic which has been implemented in the runtime.

* move.c (the cob_move_display_to_packed function was rewritten to
fix the out of bounds memory addressing issues and also to make
Expand All @@ -97,8 +116,8 @@

2024-05-30 Chuck Haatvedt <[email protected]>

fix errors in filio.c when building with VISAM 2.2. This issue
occurred when using a partial key with a sequential read previous.
fix errors in filio.c when building with VISAM 2.2. This issue
occurred when using a partial key with a sequential read previous.

* fileio.c (indexed_start_internal), (indexed_start)
and (indexed_read_next): added a new field, partial_key_length,
Expand Down Expand Up @@ -129,7 +148,7 @@

2024-07-19 Simon Sobisch <[email protected]>

* coblocal.h (COB_TLS): add a new attribute for thread local static.
* coblocal.h (COB_TLS): add a new attribute for thread local static
* common.h, common.c (cob_cleanup_thread): add a cleanup function for threads

2024-05-15 Simon Sobisch <[email protected]>
Expand Down Expand Up @@ -167,8 +186,9 @@
* fileio.c (cob_path_to_absolute): extracted from insert
and cob_set_main_argv0

2024-03-10 Alfredo Tupone <[email protected]>
2024-01-31 Gwyn Ciesla <[email protected]>

Bug #941 build issue
* common.c: add missing include libxml/parser.h

2024-02-26 Boris Eng <[email protected]>
Expand Down Expand Up @@ -776,7 +796,7 @@ after suggestions by Chuck Haatvedt <[email protected]>
* 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),
* cconv.c (cob_load_collation), common.c, intrinsic.c (cob_intr_random),
termio.c: minor adjustments to fix compiler warnings
* fileio.c (copy_fcd_to_file): fixed memory issues with writing to assign
and select name
Expand Down Expand Up @@ -836,7 +856,7 @@ after suggestions by Chuck Haatvedt <[email protected]>
* 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
* intrinsic.c (calculate_start_end_for_numval): only skip leading spaces
and zeros, but not leading low-values

2023-01-25 Simon Sobisch <[email protected]>
Expand Down Expand Up @@ -1136,8 +1156,8 @@ after suggestions by Chuck Haatvedt <[email protected]>
2022-10-17 Simon Sobisch <[email protected]>

* common.c (cob_debug_open, cob_trace_print), intrinsic.c
(cob_intr_hex_to_char): prefer extending switch over use of topupper
* call.c, common.c, intrinisic.c, screenio.c: directly call toupper/tolower
(cob_intr_hex_to_char): prefer extending switch over use of topupper
* call.c, common.c, intrinsic.c, screenio.c: directly call toupper/tolower
without previous check of islower/isupper
* system.def, common.c (cob_sys_runtime_error_proc):
implement CBL_RUNTIME_ERROR
Expand Down
4 changes: 3 additions & 1 deletion libcob/coblocal.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2007-2012, 2014-2023 Free Software Foundation, Inc.
Copyright (C) 2007-2012, 2014-2024 Free Software Foundation, Inc.
Written by Roger While, Simon Sobisch, Ron Norman
This file is part of GnuCOBOL.
Expand All @@ -22,6 +22,8 @@
#ifndef COB_LOCAL_H
#define COB_LOCAL_H

#pragma once

/* We use this file to define/prototype things that should not be
exported to user space
*/
Expand Down
Loading

0 comments on commit 903ba84

Please sign in to comment.