bug-gnucobol
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

error: invalid expression on USAGE POINTER item


From: Michael Potter
Subject: error: invalid expression on USAGE POINTER item
Date: Sun, 14 May 2023 20:02:44 -0400

Vincent Coen suggested I report this as a bug.

Two compiles of same code:

[okicks@vm-openkicks OC_GrpLvlPointer]$ cobc GRPPOINT.cbl
GRPPOINT.cbl:20: error: invalid expression

[okicks@vm-openkicks OC_GrpLvlPointer]$ cobc -V
cobc (GnuCOBOL) 4.0-early-dev.0
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart
Built     Feb 10 2023 13:51:10
Packaged  Feb 10 2023 18:49:59 UTC
C version "11.3.1 20220421 (Red Hat 11.3.1-2)"

[okicks@vm-openkicks OC_GrpLvlPointer]$ cat GRPPOINT.cbl

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    GRPPOINT.
       AUTHOR.        Replatform Technologies, LLC.
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
           01 A-W    USAGE POINTER.
              03   B-W USAGE POINTER.
              03   C-W.
       LINKAGE SECTION.
       PROCEDURE DIVISION.
           DISPLAY 'IN GRPPOINT'
           SET B-W to NULL
           SET C-W to NULL

           IF B-W NOT = NULL
                   DISPLAY "B NOT NULL"
           END-IF
           IF C-W NOT = NULL
                   DISPLAY "C NOT NULL"
           END-IF
           STOP RUN

========================================
pottmi@ubuntu ~/gitlab/cobolcompilertests/OC_GrpLvlPointer
 % cobc GRPPOINT.cbl
GRPPOINT.cbl:9: error: PICTURE clause required for 'C-W'
GRPPOINT.cbl:14: error: SET target 'C-W' is not numeric, an INDEX or a POINTER
GRPPOINT.cbl:20: error: invalid expression
pottmi@ubuntu ~/gitlab/cobolcompilertests/OC_GrpLvlPointer
 % cobc -V
cobc (GnuCOBOL) 4.0-early-dev.0
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart
Built     Oct 13 2021 18:23:24
Packaged  Oct 14 2021 01:18:06 UTC
C version "9.3.0"
pottmi@ubuntu ~/gitlab/cobolcompilertests/OC_GrpLvlPointer
 % cat GRPPOINT.cbl
       IDENTIFICATION DIVISION.
       PROGRAM-ID.    GRPPOINT.
       AUTHOR.        Replatform Technologies, LLC.
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
           01 A-W    USAGE POINTER.
              03   B-W USAGE POINTER.
              03   C-W.
       LINKAGE SECTION.
       PROCEDURE DIVISION.
           DISPLAY 'IN GRPPOINT'
           SET B-W to NULL
           SET C-W to NULL

           IF B-W NOT = NULL
                   DISPLAY "B NOT NULL"
           END-IF

           IF C-W NOT = NULL
                   DISPLAY "C NOT NULL"
           END-IF

           STOP RUN
           .



reply via email to

[Prev in Thread] Current Thread [Next in Thread]