From 8d1ba62c05923ae300304dde7e2565d6c2188398 Mon Sep 17 00:00:00 2001 From: David Declerck Date: Thu, 19 Sep 2024 14:39:17 +0200 Subject: [PATCH] ChangeLog and testsuite adjustments --- cobc/pplex.l | 1 + cobc/scanner.l | 3 +- config/ChangeLog | 8 +++ tests/testsuite.src/syn_definition.at | 73 +++++++++++++++++++++++++++ 4 files changed, 84 insertions(+), 1 deletion(-) diff --git a/cobc/pplex.l b/cobc/pplex.l index 0b7105efb..68880bb79 100644 --- a/cobc/pplex.l +++ b/cobc/pplex.l @@ -85,6 +85,7 @@ static void insert_copy_arg (void); #include #include #include +#include #include #ifdef HAVE_STRINGS_H #include diff --git a/cobc/scanner.l b/cobc/scanner.l index 15f3d1871..8e199f8a2 100644 --- a/cobc/scanner.l +++ b/cobc/scanner.l @@ -85,6 +85,7 @@ static int yywrap (void) { #include #include +#include #include #ifdef HAVE_STRINGS_H #include @@ -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 diff --git a/config/ChangeLog b/config/ChangeLog index cd1a4744f..a23c513bb 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -44,11 +44,19 @@ * rm-strict.conf: enable indirect-redefines as this was added with later RM-COBOL versions +2023-02-20 Nicolas Berthier + + * general: add ebcdic-symbolic-characters + 2023-02-16 Fabrice Le Fessant * gcos.words: remove alias VALUES=VALUE, to correctly parse "VALUES ARE" +2023-01-28 Fabrice Le Fessant + + * default.conf: change default source reference-format to 'auto' + 2023-01-25 Simon Sobisch * ibm.words, mvs.words: re-add BINARY diff --git a/tests/testsuite.src/syn_definition.at b/tests/testsuite.src/syn_definition.at index 33889dd69..15edcd145 100644 --- a/tests/testsuite.src/syn_definition.at +++ b/tests/testsuite.src/syn_definition.at @@ -2878,3 +2878,76 @@ prog.cob:6: error: 'DEPTHDR' is not defined AT_CLEANUP + +# Note: the three tests below should be combined in a single one (when fully supported) +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 -std=default -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 -std=default -Wno-pending prog.cob], [0], [], []) + +AT_CLEANUP + + +AT_SETUP([PROGRAM-POINTER TO program-prototype]) +AT_KEYWORDS([PROGRAM-POINTER PROTOTYPE]) + +# currntly 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 -std=default -Wno-unfinished prog.cob ], [0], [], []) + +AT_CLEANUP