Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/gnucobol-3.x' into gcos4gnucob…
Browse files Browse the repository at this point in the history
…ol-3.x
  • Loading branch information
ddeclerck committed Sep 20, 2024
2 parents f36f150 + 111d21f commit 015735d
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 1 deletion.
1 change: 1 addition & 0 deletions cobc/pplex.l
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ static void insert_copy_arg (void);
#include <ctype.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#ifdef HAVE_STRINGS_H
#include <strings.h>
Expand Down
3 changes: 2 additions & 1 deletion cobc/scanner.l
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ static int yywrap (void) {
#include <ctype.h>
#include <limits.h>

#include <stdio.h>
#include <string.h>
#ifdef HAVE_STRINGS_H
#include <strings.h>
Expand Down Expand Up @@ -1366,7 +1367,7 @@ scan_ebcdic_char (int c)
buff, "(1..256)");
return '?';
}
c--; // in ordinal, i.e. 1..256 -> 0..255
c--; /* in ordinal, i.e. 1..256 -> 0..255 */
#ifdef COB_EBCDIC_MACHINE
return (cob_u8_t) c;
#else
Expand Down
8 changes: 8 additions & 0 deletions config/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,19 @@
* rm-strict.conf: enable indirect-redefines as this was added
with later RM-COBOL versions

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

* general: add ebcdic-symbolic-characters

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

* gcos.words: remove alias VALUES=VALUE, to correctly parse
"VALUES ARE"

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

* default.conf: change default source reference-format to 'auto'

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

* ibm.words, mvs.words: re-add BINARY
Expand Down
69 changes: 69 additions & 0 deletions tests/testsuite.src/syn_definition.at
Original file line number Diff line number Diff line change
Expand Up @@ -2878,3 +2878,72 @@ prog.cob:6: error: 'DEPTHDR' is not defined

AT_CLEANUP


AT_SETUP([POINTER TO typedef-name])
AT_KEYWORDS([POINTER TYPEDEF])

AT_DATA([prog.cob], [
IDENTIFICATION DIVISION.
PROGRAM-ID. prog.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 data-type PIC X(10) USAGE DISPLAY IS TYPEDEF.
01 data-ptr1 USAGE POINTER data-type.
01 data-ptr2 USAGE POINTER TO data-type.
PROCEDURE DIVISION.
STOP RUN.
END PROGRAM prog.
])

AT_CHECK([$COMPILE_ONLY -Wno-pending prog.cob], [0], [], [])
AT_CLEANUP


AT_SETUP([FUNCTION-POINTER TO function-name])
AT_KEYWORDS([FUNCTION-POINTER])

AT_DATA([prog.cob], [
IDENTIFICATION DIVISION.
PROGRAM-ID. prog.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 fun-ptr1 USAGE FUNCTION-POINTER FUNCTION random.
01 fun-ptr2 USAGE FUNCTION-POINTER TO FUNCTION random.
PROCEDURE DIVISION.
STOP RUN.
END PROGRAM prog.
])

AT_CHECK([$COMPILE_ONLY -Wno-pending prog.cob], [0], [], [])
AT_CLEANUP


AT_SETUP([PROGRAM-POINTER TO program-prototype])
AT_KEYWORDS([PROGRAM-POINTER PROTOTYPE])

# currently fails -> investigate
AT_XFAIL_IF([true])

AT_DATA([prog.cob], [
IDENTIFICATION DIVISION.

PROGRAM-ID. prog-proto IS PROTOTYPE.
PROCEDURE DIVISION.
END PROGRAM prog-proto.

PROGRAM-ID. prog.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
REPOSITORY.
PROGRAM prog-proto.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 prog-ptr1 USAGE PROGRAM-POINTER prog-proto.
01 prog-ptr2 USAGE PROGRAM-POINTER TO prog-proto.
PROCEDURE DIVISION.
STOP RUN.
END PROGRAM prog.
])

AT_CHECK([$COMPILE_ONLY -Wno-unfinished prog.cob], [0], [], [])
AT_CLEANUP

0 comments on commit 015735d

Please sign in to comment.