Hi Andrew, Am 16.11.2023 um 17:56 schrieb Andrew Zwieg:
I recently updated from GNUCobol gnu-cobol-2.0 (RockyLinux 8) to gnucobol-3.2-1.el9.x86_64 (AlmaLinux 9).
Congratulations!
This code used to work on the previous version i had compiled by hand, the 3.2.1 version is provided by Alma/RedHat. 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 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.
Note that this is only a warning, cobc still compiles that. If I remember correctly only GnuCOBOL will compile that, COBOL requests a statement in there, for example CONTINUE. Add that and you have "compatible COBOL", which will also work with a previous version of GnuCOBOL (and other compilers). If you want to, you can also suppress this *along with every other dialect related* warning using `-Wno-dialect`, but fixing is commonly the better approach. Note: If you are not restricted to not use functions, then FUNCTION TRIM and/or FUNCTION STORED-CHAR-LENGTH may be quite useful and faster. Kind regards, Simon