Skip to content

Commit

Permalink
Merge SVN 4705
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeclerck committed Jul 10, 2024
1 parent bb25edb commit 0c68222
Show file tree
Hide file tree
Showing 13 changed files with 640 additions and 379 deletions.
111 changes: 111 additions & 0 deletions .github/workflows/.windows-msys2-visam.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Windows Workflow

on:
pull_request:
branches: [ gc4 ]
push:
branches: [ gc3_to_gc4 ]
# manual run in actions tab - for all branches
workflow_dispatch:

jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- windows-latest

runs-on: ${{ matrix.os }}

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@v3

- name: Install packages
uses: msys2/setup-msys2@v2
with:
update: true
install: autoconf automake libtool make mingw-w64-x86_64-libxml2 mingw-w64-x86_64-cjson mingw-w64-x86_64-db mingw-w64-x86_64-gmp libdb-devel mingw-w64-x86_64-gcc flex bison gmp-devel help2man texinfo gettext-devel

- name: Set git user
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
- name: Installing VISAM prerequisite
run: |
wget http://inglenet.ca/Products/GnuCOBOL/visam-2.2.tar.Z
tar -xvzf visam-2.2.tar.Z
cd visam-2.2
./configure --prefix=/usr/local/visam-2.2 --enable-vbisamdefault
sed -i -e "s/\(allow_undefined=\)yes/\1no/" libtool
make
make install
echo "/usr/local/visam-2.2/bin" >> $GITHUB_PATH
echo "CPATH=/usr/local/visam-2.2/include" >> $GITHUB_ENV
echo "LIBRARY_PATH=/usr/local/visam-2.2/lib" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/usr/local/visam-2.2/lib" >> $GITHUB_ENV
shell: msys2 {0}

- name: bootstrap
run: |
./autogen.sh
autoconf
autoreconf --install --force
shell: msys2 {0}

- name: Build environment setup
run: |
mkdir _build
shell: msys2 {0}

- name: configure
run: |
cd _build
../configure --with-visam --with-indexed=visam --enable-cobc-internal-checks --enable-hardening --prefix /opt/cobol/gnucobol --exec-prefix /opt/cobol/gnucobol
shell: msys2 {0}

- name: Upload config.log
uses: actions/upload-artifact@v3
if: failure()
with:
name: config.log
path: _build/config.log

- name: make
run: |
cd _build
make --jobs=$(($(nproc)+1))
shell: msys2 {0}

- name: install
run: |
cd _build
make install
find /opt/cobol > install.log
shell: msys2 {0}

- name: Upload install.log
uses: actions/upload-artifact@v3
with:
name: install.log
path: _build/install.log

- name: check
run: |
export PATH=/opt/cobol/gnucobol/bin:$PATH
cd _build/tests
make check TESTSUITEFLAGS="--jobs=$(($(nproc)+1))"
shell: msys2 {0}

# make check TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" || (echo "not all tests passed")
# make test

- name: Upload testsuite.log
uses: actions/upload-artifact@v3
if: failure()
with:
name: testsuite.log
path: _build/tests/testsuite.log
1 change: 1 addition & 0 deletions .github/workflows/macos-bdb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- name: configure
run: |
cd _build
export CPPFLAGS="-DREAD_WRITE_NEEDS_FLUSH $CPPFLAGS"
export CFLAGS="-Wno-deprecated-non-prototype -Wno-parentheses-equality $CFLAGS"
../configure --with-db --with-indexed=db --enable-cobc-internal-checks --enable-hardening --prefix /opt/cobol/gnucobol --exec-prefix /opt/cobol/gnucobol
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/macos-visam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
- name: configure
run: |
cd _build
export CPPFLAGS="-DREAD_WRITE_NEEDS_FLUSH $CPPFLAGS"
export CFLAGS="-Wno-deprecated-non-prototype -Wno-parentheses-equality $CFLAGS"
../configure --with-visam --with-indexed=visam --enable-cobc-internal-checks --enable-hardening --prefix /opt/cobol/gnucobol --exec-prefix /opt/cobol/gnucobol
Expand Down
2 changes: 2 additions & 0 deletions cobc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,8 @@
cb_search to at_end, storing pair of AT END (position) and statements
* codegen.c (output_search_whens, output_search_all): adjust output of
source references for better debugging experience and add AT END tracing
* typeck.c: Remove ERROR for REWRITE an INPUT-OUTPUT of LINE SEQUENTIAL
This has been supported for a while in rw/trunk

2021-12-30 Ron Norman <[email protected]>

Expand Down
20 changes: 10 additions & 10 deletions cobc/typeck.c
Original file line number Diff line number Diff line change
Expand Up @@ -3124,10 +3124,10 @@ cb_build_const_next (struct cb_field *f)
p = p->parent;
}
if (!p->flag_external) {
cb_error (_("VALUE of '%s': %s target is invalid"), f->name, "NEXT");
cb_error (_("target must be in FILE SECTION or LINKAGE SECTION or have the EXTERNAL clause"));
return cb_build_numeric_literal (0, "1", 0);
}
cb_error (_("VALUE of '%s': %s target is invalid"), f->name, "NEXT");
cb_error (_("target must be in FILE SECTION or LINKAGE SECTION or have the EXTERNAL clause"));
return cb_build_numeric_literal (0, "1", 0);
}
}

/*
Expand Down Expand Up @@ -8708,10 +8708,10 @@ cb_emit_call (cb_tree prog, cb_tree par_using, cb_tree returning,
if (CB_TREE_CLASS (returning) != CB_CLASS_NUMERIC &&
CB_TREE_CLASS (returning) != CB_CLASS_POINTER) {
cb_error_x (CB_TREE (current_statement),
_("invalid RETURNING field"));
return;
_("invalid RETURNING field"));
return;
}
}
}

error_ind = 0;

Expand Down Expand Up @@ -13030,9 +13030,9 @@ cb_emit_rewrite (cb_tree record, cb_tree from, cb_tree lockopt)
cb_error_x (CB_TREE (current_statement),
_("%s not allowed on %s files"), "REWRITE", "REPORT");
return;
} else if (current_statement->handler_type == INVALID_KEY_HANDLER
&& f->organization != COB_ORG_RELATIVE
&& f->organization != COB_ORG_INDEXED) {
} else if (current_statement->handler_type == INVALID_KEY_HANDLER &&
(f->organization != COB_ORG_RELATIVE &&
f->organization != COB_ORG_INDEXED)) {
cb_error_x (CB_TREE(current_statement),
_("INVALID KEY clause invalid with this file type"));
return;
Expand Down
13 changes: 13 additions & 0 deletions config/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

* *.conf: changed top-level-occurs-clause "skip" to "unconformable"

2022-09-21 Simon Sobisch <[email protected]>

* runtime.cfg: extend docs for LINE SEQUENTIAL settings

2022-08-17 Simon Sobisch <[email protected]>

* general: add xml-parse-xmlss, note: explicit NOT enabled
Expand Down Expand Up @@ -141,6 +145,11 @@
default.conf, in all other cases no change to RECURSIVE attribute
is happening any more, fixing bug 686

2021-07-05 Ron Norman <[email protected]>

* runtime.cfg: added COB_SEQ_CONCAT_NAME and COB_SEQ_CONCAT_SEP used
for 'concatenated input files'

2021-03-05 Ron Norman <[email protected]>

* runtime.cfg (fileio): added COB_FILE_ISNODAT to disable ISAM datafile.dat
Expand Down Expand Up @@ -642,6 +651,10 @@
marked as not verified yet)
* general: added literal-length, numeric-literal-length

2015-03-14 Ron Norman <[email protected]>

* runtime.cfg: add COB_LS_VALIDATE

2015-03-14 Ron Norman <[email protected]>

* runtime.cfg: added all configuration options with documentation
Expand Down
30 changes: 16 additions & 14 deletions config/runtime.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,19 @@
# Alias: STRIP_TRAILING_SPACES (0 = yes)
# Type: boolean
# Default: false
# Note: This setting is most useful if you want to REWRITE those
# files.
# Example: LS_FIXED TRUE

# Environment name: COB_LS_VALIDATE
# Parameter name: ls_validate
# Purpose: Defines for LINE SEQUENTIAL files that the data should be
# validated as it is read (status 09) / written (status 71).
# Type: boolean
# Default: true (per COBOL 2022)
# Note: If active effectively disables COB_LS_NULLS.
# Example: LS_VALIDATE FALSE

# Environment name: COB_LS_NULLS
# Parameter name: ls_nulls
# Purpose: Defines for LINE SEQUENTIAL files what to do with data
Expand All @@ -406,7 +417,11 @@
# Type: boolean
# Default: true (for MF files) otherwise false
# Note: The TRUE setting will insert a null character x"00" before
# those values to escape them, and redo on read-in.
# those values to escape them, and redo on read-in plus
# validating that they only occur after a null character.
# Decreases LINE SEQUENTIAL performance and prevents writing
# escape sequences or formatting within the data.
# Only checked if COB_LS_VALIDATE is disabled.
# Example: LS_NULLS = TRUE

# Environment name: COB_LS_SPLIT
Expand All @@ -420,19 +435,6 @@
# (per COBOL 202x)
# Example: LS_SPLIT = FALSE

# Environment name: COB_LS_VALIDATE
# Parameter name: ls_validate
# Purpose: Defines for LINE SEQUENTIAL files that the data should be
# validated. If any record has non-DISPLAY characters then
# an error status of 71 is returned
# This option is only for GnuCOBOL format files
# Type: boolean
# Default: true
# Note: The TRUE setting does data validation
# The FALSE setting lets non-DISPLAY characters be written
# If LS_NULLS is set, then LS_VALIDATE is not checked
# Example: LS_VALIDATE = FALSE

# Environment name: COB_LS_INSTAB
# Parameter name: ls_instab
# Purpose: Defines for LINE SEQUENTIAL files that multiple spaces
Expand Down
45 changes: 41 additions & 4 deletions libcob/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,14 @@
PERFORM stack and used for restoring those on return
* common.h (cob_module): fields for current frame_ptr

2022-09-21 Simon Sobisch <[email protected]>

* common.c, fileio.c: change COB_LS_VALIDATE to be the default and to
override COB_LS_NULLS
* fileio.c: fix bug #853 pass \r to validation / COBOL if it isn't
followed by \n
* fileio.c: minor refactor - use of separate FILE *fp

2022-09-13 Simon Sobisch <[email protected]>

* intrinsic.c (cob_check_numval): fix missing check for
Expand Down Expand Up @@ -441,6 +449,13 @@
* screenio.c (cob_field_display): If no field, use empty field as default
This is to handle DISPLAY OMITTED

2022-02-04 Simon Sobisch <[email protected]>

* general: backport of REWRITE in LINE SEQUENTIAL (especially: record_off),
COB_LS_VALIDATE to check LINE SEQUENTIAL files during read/write,
COB_SEQ_CONCAT_NAME and COB_SEQ_CONCAT_SEP, and other file specific
features

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

* call.c (set_resolve_error): distinguish between exceptions
Expand Down Expand Up @@ -688,7 +703,8 @@

* common.c: Runtime report show 'not set' if that was the default
* fileio.c: Change default for LS_SPLIT = TRUE
Check LINE SEQUENTIAL data and if invalid return 09 status
* fileio.c (lineseq_read): Check LINE SEQUENTIAL data and if invalid
return 09 status per COBOL 2022

2021-10-01 Ron Norman <[email protected]>

Expand Down Expand Up @@ -872,6 +888,15 @@

* fextfh.c: Check FCD-CURRENT-REC-LEN being changed on WRITE/REWRITE

2021-07-05 Ron Norman <[email protected]>

* common.h (cob_file): Added flag_is_concat, org_filename and nxt_filename
* common.c: Handle runtime options COB_SEQ_CONCAT_NAME and
COB_SEQ_CONCAT_SEP used for 'concatenated input files'
* coblocal.h (cob_settings): Added fields for concatenated files
* fileio.c: Add code to handle SEQUENTIAL and LINE SEQUENTIAL
concatenated input files for OPEN INPUT and I-O

2021-07-02 Simon Sobisch <[email protected]>

* reportio.c: move hard line/col limit to REPORT_MAX_LINES REPORT_MAX_COLS
Expand Down Expand Up @@ -1846,6 +1871,7 @@
* fileio.c: For LINE SEQUENTIAL and OPEN I-O some platforms
(SUNOS for one) require that a fflush be done
between each read/write of the file
Simon 2022-02-04: for now surrounded with [READ_WRITE_NEEDS_FLUSH]
* common.h,move.c,sysdefines.h: Updates for speeding up arithmetic

2020-04-17 Ron Norman <[email protected]>
Expand All @@ -1857,8 +1883,8 @@
2020-04-14 Ron Norman <[email protected]>

* fileio.c: Fixed to NOT mix I/O to FILE * via putc and 'int fd' via write
'FILE *' is buffered and 'int fd' is NOT so the data
can end up in a very strange sequence in the file
'FILE *' is buffered and 'int fd' is NOT so the data
could end up in a very strange sequence in the file

2020-04-14 Ron Norman <[email protected]>

Expand Down Expand Up @@ -2072,7 +2098,7 @@

2019-11-14 Ron Norman <[email protected]>

* common.c: Fix for display of runtime options
* common.c (get_config_val): fix for display of runtime options
* fileio.c: If bad data in LINE SEQUENTIAL file cause error status 71
instead of 34

Expand Down Expand Up @@ -3701,6 +3727,12 @@

2016-06-20 Ron Norman <[email protected]>

* common.h: added some COB_CHAR_xxx to define some characters
* fileio.c: for LINE SEQUENTIAL files with COB_LS_VALIDATE = true
changed bad data error from 30 to 34
Also allow some characters thru such as BS, FF, TAB, ESC, SI
No data validation is done for LINE ADVANCING output files

* coblocal.h, common.c: FR #138 identify config variables which accept
a path list and any which only accept a single directory/file
are checked for the PATH_SEP character and error is given if
Expand Down Expand Up @@ -4098,6 +4130,11 @@
New runtime option (mf_files) to set all files to default
to Micro Focus format

2015-04-27 Ron Norman <[email protected]>

* fileio.c, common.h (cob_file): updated to support line sequential rewrite
* fileio.c, common.c, coblocal.h (cob_settings): new COB_LS_VALIDATE

2015-04-14 Ron Norman <[email protected]>

* reportio.c common.c:
Expand Down
2 changes: 1 addition & 1 deletion libcob/coblocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ typedef struct __cob_settings {
unsigned int cob_unix_lf; /* Use POSIX LF */
unsigned int cob_do_sync;
unsigned int cob_ls_fixed; /* Line Sequential is fixed length */
unsigned int cob_ls_validate; /* Validate data in Line Sequential */
unsigned int cob_ls_nulls; /* NUL insert to Line Sequential */
unsigned int cob_ls_split; /* Split 'too long' record into parts (Default is truncate) */
unsigned int cob_ls_validate; /* Validate data in Line Sequential */
unsigned int cob_ls_instab; /* TAB insert to Line Sequential (INSERTTAB)*/
unsigned int cob_varseq_type; /* Variable Sequential Default file format */
unsigned int cob_varrel_type; /* Variable Relative default file format */
Expand Down
Loading

0 comments on commit 0c68222

Please sign in to comment.