Menu

#875 V IS ZERO AND ... generate 'invalid conditional expression' error

GC 3.x
closed
cobc (106)
5 - default
2023-07-04
2023-02-20
No

When compiling the program:

       IDENTIFICATION   DIVISION.
       PROGRAM-ID.      prog.
       DATA             DIVISION.
       WORKING-STORAGE  SECTION.
       01  V            PIC 9 VALUE 0.
       01  W            PIC 9 VALUE 1.
       PROCEDURE        DIVISION.
           IF V IS ZERO
              DISPLAY "V IS ZERO"
           END-IF.
           IF W EQUAL 1 AND V IS ZERO
              DISPLAY "W EQUAL 1 AND V IS ZERO"
           END-IF.
           IF V IS ZERO AND W EQUAL 1
              DISPLAY "V IS ZERO AND W EQUAL 1"
           END-IF.

with version gnucobol-3.x, I get:

╰─➤ cobc -x prog.cob                                                    prog.cob:14: error: invalid conditional expression
zsh: exit 1     cobc -x prog.cob

The third expression is only a permutation of the second expression.

Discussion

  • Simon Sobisch

    Simon Sobisch - 2023-05-05

    Is [bugs:#880] a duplicate of this issue?

     

    Related

    Bugs: #880

  • Simon Sobisch

    Simon Sobisch - 2023-05-05
    • labels: --> cobc
    • status: open --> accepted
     
  • Chuck H.

    Chuck H. - 2023-07-02

    As per the current commit of R5097 on Windows build via MSYS2, this bug appears to be fixed

    F:\AA-minGW32-static>cobc  -x bug875.cbl
    
    F:\AA-minGW32-static>bug875
    V IS ZERO
    W EQUAL 1 AND V IS ZERO
    V IS ZERO AND W EQUAL 1
    
    F:\AA-minGW32-static>
    
     
  • Chuck H.

    Chuck H. - 2023-07-04
    • status: accepted --> closed
     
  • Simon Sobisch

    Simon Sobisch - 2023-07-04

    fixed by [r5093]

     

    Related

    Commit: [r5093]


Log in to post a comment.