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 Jul 2, 2023
2 parents 743651f + 3e78202 commit 57e7a28
Show file tree
Hide file tree
Showing 33 changed files with 669 additions and 126 deletions.
6 changes: 5 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ NEWS - user visible changes -*- outline -*-
affected programs (with OCCURS DEPENDING ON) or compile with additional
-fno-odoslide to get the same results as with older GnuCOBOL versions

** the compile flag -fdefaultbyte (initializarion for data-items without
** the compile flag -fdefaultbyte (initialization for data-items without
an explicit VALUE) was moved to a dialect configuration;
while -fdefaultbyte still works as before it is now implied as binary
zero with -std=ibm/mvs/bs2000/realia, space for -std=mf/acu/rm, and
Expand All @@ -255,6 +255,10 @@ NEWS - user visible changes -*- outline -*-
note that initialization for INDEXED BY items honors the defaultbyte
configuration now, too

** new dialect init-justified that applies right justification by JUSTIFIED
clause for VALUE clause; this is applied to IBM dialects, if you want
the previous behavior compile with -fno-init-justified

** the dialect configuration option larger-redefines-ok was replaced by
the support option larger-redefines; if specified on the command-line
it is now -f[no-]larger-redefines instead of -f[no-]larger-redefines-ok,
Expand Down
5 changes: 5 additions & 0 deletions bin/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

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

* cob-config: echo in same order as arguments. Add missing
arguments (--bindir,--libdir,--datadir,--mandir,--includedir)

2022-10-18 Simon Sobisch <[email protected]>

* cobcrun.c: minor validation - check for empty parameters
Expand Down
49 changes: 26 additions & 23 deletions bin/cob-config.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ exec_prefix=${prefix}
exec_prefix_set=no
libdir=@libdir@
includedir=@includedir@
bindir=@bindir@
datadir=@datadir@
includedir=@includedir@
mandir=@mandir@

version="@VERSION@.@COB_PATCH_LEVEL@"
cflags="@COB_CFLAGS@"
Expand Down Expand Up @@ -76,24 +80,39 @@ while test $# -gt 0; do
exec_prefix=$optarg
fi
;;
--prefix)
echo_prefix=yes
;;
--exec-prefix=*)
exec_prefix=$optarg
exec_prefix_set=yes
;;
--prefix)
echo ${prefix}
;;
--exec-prefix)
echo_exec_prefix=yes
echo ${exec_prefix}
;;
--version)
echo $version
echo ${version}
;;
--cflags)
echo_cflags=yes
echo ${cflags}
;;
--libs)
echo_libs=yes
echo ${libs}
;;
--bindir)
echo ${bindir}
;;
--datadir)
echo ${datadir}
;;
--includedir)
echo ${includedir}
;;
--libdir)
echo ${libdir}
;;
--mandir)
echo ${mandir}
;;
--help)
cat <<EOF
Expand All @@ -109,19 +128,3 @@ EOF
esac
shift
done

if test "$echo_prefix" = "yes"; then
echo $prefix
fi

if test "$echo_exec_prefix" = "yes"; then
echo $exec_prefix
fi

if test "$echo_cflags" = "yes"; then
echo $cflags
fi

if test "$echo_libs" = "yes"; then
echo $libs
fi
4 changes: 4 additions & 0 deletions build_windows/ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

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

* config.h.in: updated for OrangeC 6.0.70.2

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

* makedist.cmd: first addition for CI output
Expand Down
19 changes: 12 additions & 7 deletions build_windows/config.h.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/* config.h, tested with x86/x64 VS2005-2022
and OrangeC 6.0.50 (which ignores the lib comments) */
and OrangeC 6.0.70.2 (which ignores the lib comments) */

#define NOISAM 0
#define BDB 1
Expand Down Expand Up @@ -255,7 +255,11 @@
#undef COB_CFLAGS

/* Compilation of computed gotos works */
#if defined(__ORANGEC__)
#define COB_COMPUTED_GOTO
#else
/* #undef COB_COMPUTED_GOTO */
#endif

/* default search path for copybooks */
#define COB_CONFIG_DIR COB_MAIN_DIR "\\config"
Expand All @@ -267,7 +271,7 @@
#if defined(__ORANGEC__)
#define COB_DEBUG_FLAGS "-g"
#else
#undef COB_DEBUG_FLAGS
/* #undef COB_DEBUG_FLAGS */
#endif

/* Enable internal logging (Developers only!) */
Expand All @@ -283,7 +287,7 @@
#if defined(__ORANGEC__)
#define COB_EXPORT_DYN "" /* needs to be specified for all but MSVC */
#else
#undef COB_EXPORT_DYN
/* #undef COB_EXPORT_DYN */
#endif

/* Keyword for inline */
Expand Down Expand Up @@ -326,14 +330,14 @@
#if defined(__ORANGEC__)
#define COB_PIC_FLAGS "" /* needs to be specified for all but MSVC */
#else
#undef COB_PIC_FLAGS
/* #undef COB_PIC_FLAGS */
#endif

/* Compile/link option for shared code */
#if defined(__ORANGEC__)
#define COB_SHARED_OPT "/Wd"
#else
#undef COB_SHARED_OPT
/* #undef COB_SHARED_OPT */
#endif

/* Strip command */
Expand All @@ -343,7 +347,7 @@
#ifdef _DEBUG
#define COB_TREE_DEBUG
#else
#undef COB_TREE_DEBUG
/* #undef COB_TREE_DEBUG */
#endif

/* Define to 1 if translation of program messages to the user's native
Expand Down Expand Up @@ -441,10 +445,11 @@
/* #undef HAVE_DEFINE_KEY */

/* Has designated initializers */
/* #undef HAVE_DESIGNATED_INITS */
#if defined(_MSC_VER) && _MSC_VER >= 1800 /* = COB_USE_VC2013_OR_GREATER [which is defined later] */ \
|| defined(__ORANGEC__)
#define HAVE_DESIGNATED_INITS 1
#else
/* #undef HAVE_DESIGNATED_INITS */
#endif


Expand Down
46 changes: 36 additions & 10 deletions cobc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@

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

* scanner.l: add check for reserved word FUNCTION, add missing
word value for not reserved SUPPRESS and SEND
* parser.y (at_line_column): fixed bad cast when conflicting clauses
were used, fixing bug #601

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

* codegen.c (output_function_prototypes): generate plain "extern"
instead of "COB_EXT_IMPORT" again, as the second only works with
libraries, not with object files / sources

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

FR #439: dialect option to support justify for IBM compatibility
* config.def: new dialect configuration option init-justify
* codegen.c (output_initialize_to_value): added support for right
justification when cb_initial_justify is on

2023-06-23 Fabrice Le Fessant <[email protected]>

* pplex.l (get_word): fix an overflow with words exceeding the
maximal size COB_MAX_WORDLEN
* pplex.l (is_condition_directive_clause)
(next_word_is_comment_paragraph_name): decrease stack storage
and optimize string comparisons
maximal size COB_MAX_WORDLEN
* pplex.l (is_condition_directive_clause,
next_word_is_comment_paragraph_name): decrease stack storage
and optimize string comparisons

2023-06-22 Nicolas Berthier <[email protected]>

Expand All @@ -23,6 +43,12 @@
typeck.c (cb_build_identifier): new dialect configuration option
subscript-check to limit bound checks for ODO items

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

Bugs #875 V IS ZERO AND, #880 error compiling abbreviated conditions
* typeck.c (cb_build_expr): additional generate 'invalid conditional
expression' error", translate NOT comparison to inversed comparison

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

* typeck.c (cb_build_expr): remove cb_ prefix from static functions
Expand Down Expand Up @@ -6951,11 +6977,11 @@
* parser.y, reserved.c, typeck.c: Added parser support for OCCURS DYNAMIC
along with CAPACITY clause as not implemented

2014-09-08 Philipp Bhme <[email protected]>
2014-09-08 Philipp B hme <[email protected]>

* cobc.c (process) [_MSC_VER]: bugfix in output filter

2014-09-03 Philipp Bhme <[email protected]>
2014-09-03 Philipp B hme <[email protected]>

* cobc.c, cobc.h: added cobc_free() function
(Own freeing functions for debugging purposes.
Expand Down Expand Up @@ -7003,11 +7029,11 @@
* pplex.l: fixed bug #86 whitespace handling for IDENTIFICATION DIVISION
and DEBUGGING MODE

2014-07-10 Philipp Bhme <[email protected]>
2014-07-10 Philipp B hme <[email protected]>

* typeck.c (cb_emit_sort_init): calculation of table key offset fixed

2014-07-02 Philipp Bhme <[email protected]>
2014-07-02 Philipp B hme <[email protected]>

* cobc.c [_MSC_VER]: filter output of cl.exe (instead of redirecting to
NUL), errors are printed in non-verbose mode now; new: (read_buffer_line)
Expand Down Expand Up @@ -7046,7 +7072,7 @@

* parser.y: Added extension "USE AT PROGRAM START/END" as not implemented

2014-05-14 Philipp Bhme <[email protected]>
2014-05-14 Philipp B hme <[email protected]>

* cobc.c: Catch and treat error when no disc space is available for
output files
Expand All @@ -7059,7 +7085,7 @@

* parser.y: Added extension "GOBACK/EXIT PROGRAM RETURNING/GIVING x"

2014-04-29 Philipp Bhme <[email protected]>
2014-04-29 Philipp B hme <[email protected]>

* codeoptim.c: Fixed bug in COB_ADD_PACKED_INT.
Computing COMP-3 failed in MSVC-build versions,
Expand Down
18 changes: 16 additions & 2 deletions cobc/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -5034,6 +5034,14 @@ output_initialize_to_value (struct cb_field *f, cb_tree x,

if ((int)l->size >= (int)size) {
memcpy (litbuff, l->data, (size_t)size);
if (f->flag_justified && cb_initial_justify) {
memcpy (litbuff, l->data + (size_t)l->size - (size_t)size, (size_t)size);
} else {
memcpy (litbuff, l->data, (size_t)size);
}
} else if (f->flag_justified && cb_initial_justify) {
memset (litbuff, ' ', (size_t)size - l->size);
memcpy (litbuff + l->size, l->data, (size_t)l->size);
} else {
memcpy (litbuff, l->data, (size_t)l->size);
memset (litbuff + l->size, ' ', (size_t)size - l->size);
Expand Down Expand Up @@ -13225,7 +13233,10 @@ output_function_prototypes (struct cb_program *prog)
may use the same but not-default function */
if (strcmp (prog->extfh, extfh_value) != 0
&& strcmp ("EXTFH", extfh_value) != 0) {
output_line ("COB_EXT_IMPORT int %s (unsigned char *opcode, FCD3 *fcd);",
/* note: we may not use COB_EXT_IMPORT here as that only works with
entry points in libraries, not with direct provided object files
which we at least expect in our testsuite */
output_line ("extern int %s (unsigned char *opcode, FCD3 *fcd);",
extfh_value);
}
}
Expand All @@ -13246,7 +13257,10 @@ output_function_prototypes (struct cb_program *prog)
/* prototype for general EXTFH function */
if (prog->file_list && prog->extfh
&& strcmp ("EXTFH", prog->extfh) != 0) {
output ("COB_EXT_IMPORT int %s (unsigned char *opcode, FCD3 *fcd);", prog->extfh);
/* note: we may not use COB_EXT_IMPORT here as that only works with
entry points in libraries, not with direct provided object files
which we at least expect in our testsuite */
output ("extern int %s (unsigned char *opcode, FCD3 *fcd);", prog->extfh);
output_newline ();
}

Expand Down
3 changes: 3 additions & 0 deletions cobc/config.def
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ CB_CONFIG_BOOLEAN (cb_complex_odo, "complex-odo",
CB_CONFIG_BOOLEAN (cb_odoslide, "odoslide",
_("adjust items following OCCURS DEPENDING (implies complex-odo)"))

CB_CONFIG_BOOLEAN (cb_initial_justify, "init-justify",
_("applies JUSTIFY with VALUE clause"))

CB_CONFIG_BOOLEAN (cb_indirect_redefines, "indirect-redefines",
_("allow REDEFINES to other than last equal level number"))

Expand Down
8 changes: 6 additions & 2 deletions cobc/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -11881,7 +11881,9 @@ at_line_column:

if (!line_column) {
line_column = CB_BUILD_PAIR ($2, cb_int0);
} else {
} else if (CB_PAIR_P (line_column)) {
/* note: if line_column is set but no pair, we already
raised a conflict error as AT pos was used before */
CB_PAIR_X (line_column) = $2;
}
}
Expand All @@ -11897,7 +11899,9 @@ at_line_column:

if (!line_column) {
line_column = CB_BUILD_PAIR (cb_int0, $2);
} else {
} else if (CB_PAIR_P (line_column)) {
/* note: if line_column is set but no pair, we already
raised a conflict error as AT pos was used before */
CB_PAIR_Y (line_column) = $2;
}
}
Expand Down
Loading

0 comments on commit 57e7a28

Please sign in to comment.