I recently updated from GNUCobol gnu-cobol-2.0 (RockyLinux 8) to gnucobol-3.2-1.el9.x86_64 (AlmaLinux 9). This code used to work on the previous version i had compiled by hand, the 3.2.1 version is provided by Alma/RedHat.
PERFORM VARYING LastIndex FROM 50 by -1 UNTIL
FromChar(LastIndex) NOT EQUAL SPACE
OR
LastIndex = 1
END-PERFORM.
cobc -x autorfc.broke.cob
autorfc.broke.cob: in paragraph 'Append':
autorfc.broke.cob:140: warning: inline PERFORM without imperative statement used [-Wdialect]
138 | OR
139 | LastIndex = 1
140 > END-PERFORM.
141 |
142 | PERFORM VARYING FromIndex FROM 1 BY 1 UNTIL
autorfc.broke.cob: in paragraph 'Append':
autorfc.broke.cob:140: warning: inline PERFORM without imperative statement used [-Wdialect]
138 | OR
139 | LastIndex = 1
140 > END-PERFORM.
141 |
142 | PERFORM VARYING FromIndex FROM 1 BY 1 UNTIL
Relevant Code Snippet (can provide more/all code if needed)
PERFORM VARYING LastIndex FROM 50 by -1 UNTIL
FromChar(LastIndex) NOT EQUAL SPACE
OR
LastIndex = 1
END-PERFORM.