opensourcecobol / Open-COBOL-ESQL

Open Cobol ESQL (ocesql) is an open-source Embedded SQL pre-compiler and run-time library designed for COBOL applications which access an open-source database.
https://www.osscons.jp/osscobol/
GNU Lesser General Public License v3.0
50 stars 24 forks source link

Translation error with a source code containing a variable initialized to empty string. #43

Closed yutaro-sakamoto closed 2 years ago

yutaro-sakamoto commented 2 years ago

Open-COBOL-ESQL cannot convert the following source code. Open-COBOL-ESQL does not accept source code containing a variable initialized to an empty string.

       IDENTIFICATION              DIVISION.
       PROGRAM-ID.                 a.
       DATA                        DIVISION.
       WORKING-STORAGE             SECTION.
       01 VAL PIC X(5) VALUE "".
       PROCEDURE                   DIVISION.
           DISPLAY "Hello".
           STOP RUN.

If opensource COBOL compiles the source code, compiling succeeds while cobc displays warning messages.

a.cbl:5: Warning: Alphanumeric literal has zero length
a.cbl:5: Warning: A SPACE will be assumed
yutaro-sakamoto commented 2 years ago

I merged the fix to v1.3.