@comment ****************************************************************************
@comment ** F2. Summary of Compiler Changes since 2009 and version v1.1 & v3.1 dev ***
@comment ****************************************************************************

@newappendix {F2,Summary of Compiler Changes after GnuCOBOL Compiler v2.2}
There may well be some changes made that are not documented here.

Taken from Grammar Changelog June 2019.
@enumerate

@item
General
@itemize @bullet


@item
C API (configuration): added cob_set_runtime_option and cob_get_runtime_option for specifying the file handle which printer output or trace output should go to.

@item
cobc command-line options: added -fcallfh (and COBOL-IT alias -use-extfh).

@item
cobc command-line options: added -fdump to dump data of all modules on abend of program.

@item
cobc command-line options: disabled -fif-cutoff pending removal.

@item
cobc command-line options: added -fno-remove-unreachable to disable removal of unreachable code.

@item
cobc command-line options: -debug no longer implies -ftrace (bug #449).

@item
cobc command-line options: added -O0 for disabling optimisations (feature request #255).

@item
cobc command-line options: replaced -tsymbols by -f(no)-tsysmbols.

@item
cobc command-line options: added -fno-theader, -fno-tmessages and -fno-tsource to suppress parts of listings.

@item
cobc command-line options: added -Wno-dialect to suppress dialect-specific warnings.

@item
cobc command-line options: added -Wother to enable miscellaneous warnings.

@item
cobcrun command-line options: renamed -runtime-conf to -runtime-config.

@item
COBOL-85 NIST testsuite: tests can now be downloaded from Sourceforge when the NIST website is unavailable (bug #563).

@item
COBOL-85 NIST testsuite: tests can now be performed individually by running make in the test module directory.

@item
Copyfiles: fixed segfault when GnuCOBOL tried and failed to open a copyfile (bug #458).

@item
Copyfiles: GnuCOBOL now checks for recursive copyfiles (bug #467).

@item
Debugging: Added debug logging for compiler developers (--enable-debug-log).

@item
Dependencies: GnuCOBOL now (optionally) depends on libxml2 and cJSON (for XML and JSON I-O).

@item
DJGGP support: added minimal support for DJGGP.

@item
Error messages: runtime error messages now use translated versions (depending on a user's language).

@item
Error messages: added checks for version control conflict markers in source code.

@item
Expressions: fixed bug #431, where decimal constants were not initialised in INITIAL programs.

@item
EXTFH: added support for the external file handler (EXTFH) interface, letting users provide a custom file handler.

@item
IBM i support: fixed segfault involving filepaths

@item
Listings: fixed the substitution of tokens in quotes in copyfiles (bug #494).

@item
Listings: fixed some cases of cross-reference listings containing wrong line numbers.

@item
Listings: now require the size of a listing page to be at least 20 lines.

@item
Listings: fixed segfault in listing programs with large REPLACE arguments (bug #515).

@item
Modules: enabled running of modules generated with older versions of GnuCOBOL (feature request #239).

@item
National literals: added Fujitsu NC national character literals (feature request #352).

@item
Nested programs: fixed bug #435, where identifiers in the containing program where not propagated to the contained program, causing a segfault.

@item
OrangeC support: added minimal support for OrangeC.

@item
Recursion: fixed bug #222, where the return value was lost when returning from a recursive call.

@item
Reserved words: allow users to make default reserved words aliases for other words.

@item
Screen section testsuite: added a manual testsuite for screen section functionality patch #26.

@item
Signals: added error message for SIGFPE (bug #434).

@item
Solaris support: fixed errors and warnings when compiling in Solaris 10.

@item
Tracing: added new options for controlling tracing (feature request #242).

@item
User-defined words: increased default maximum user-defined length to 63 characters (per COBOL~202X draft standard).

@end itemize


@item
Configuration options
@itemize @bullet

@item
IBM dialect: reserved words updated to Enterprise COBOL V6.2.

@item
incorrect-conf-sec-order option: changed to ``ok'' from ``error'' in mf and default dialects.

@item
New compiler configuration options: binary-comp-1, call-convention-mnemonic, call-convention-linkage, continue-after, display-special-fig-consts, free-redefines-position (feature request #211), line-col-zero-default, national-character-literals move-figurative-space-to-numeric, move-non-numeric-lit-to-numeric-is-zero, missing-statement, perform-without-varying-by, record-delimiter, record-delim-with-fixed-recs, records-mismatch-record-clause, screen-section-rules, sequential-delimiters, symbolic-constant, xml-generate-extra-phrases, zero-length-literals.

@item
New runtime configuration options: col_just_lrc (for enablingdisabling the LEFT slash RIGHT slash CENTER phrases of the report COLUMN clause), printer and display_print_pipe (for specifying what command should be executed before DISPLAY UPON PRINTER; similar to Micro Focus' COBPRINTER option); display_print_file (name of file which DISPLAY UPON PRINTER will append its output to), display_punch_file (name of file to created upon first DISPLAY UPON SYSPUNCH), trace_format, dump_file and dump_width.

@item
Registers: disabling a register also removes the reserved word with the same name, if it exists (feature request #278).

@item
Registers: added COL and LIN. added LINKAGE phrase.
@end itemize


@item
Compiler directives
@itemize @bullet

@item
COPY statement: added support for copybook and library names containing periods as text-names. For example,  ``COPY copybook.cpy.'' is now accepted. See feature request #344.

@item
Fujitsu OPTIONS directive: added recognition of.

@item
New directives: ADDRSV, ADDSYN, MAKESYN, OVERRIDE and REMOVE (feature request #210); CALLFH and COMP1.
@end itemize


@item
Identification division
@itemize @bullet

@item
OPTIONS paragraph: added support for ARITHMETIC clause.
@end itemize


@item
Environment division
@itemize @bullet

@item
ALTERNATE RECORD KEY clause: implemented split keys (SOURCE IS; feature request #23) and sparse keys (SUPPRESS WHEN; feature request #281).

@item
ALPHABET clause: added recognition of more pre-defined alphabets.

@item
ASSIGN clause: re-enabled use of linkage section or BASED items (bug #421).

@item
ASSIGN clause: added SYSPCH and SYSPUNCH device-names for writing to a punch file (this is not related to CARD-PUNCH).

@item
ASSIGN clause: added device-names S01 through to S05.

@item
CALL-CONVENTION phrase: added C and PASCAL (see feature request #311).

@item
CLASS phrase: added recognition of ALPHANUMERIC NATIONAL and alphabet phrases.

@item
CLASS phrase: fixed bug #566, where class-names were not inherited by nested subprograms.

@item
CURRENCY phrase: changed to emit error when CURRENCY SIGN other than `$' is entered.

@item
CURRENCY phrase: improved error messages for invalid currency signs.

@item
EXTERN clause: improved error messages (bug #446).

@item
FILE STATUS clause: added detection of VSAM secondary status identifier (feature request #51).

@item
I-O-CONTROL paragraph: added detection of APPLY COMMIT clause (from the COBOL~202X draft standard).

@item
OBJECT-COMPUTER paragraph: added recognition of NATIONAL collating sequences.

@item
OCCURS clause: correctly implemented nested OCCURS DEPENDING tables (ODOSLIDE).

@item
PASSWORD clause: added detection of.

@item
RECORD clause: fixed behaviour in the IBM dialect when the maximum record length does not match the length in the RECORD clause.

@item
RECORD DELIMITER phrase:  added support for BINARY-SEQUENTIAL and LINE-SEQUENTIAL phrases.

@item
RECORD DELIMITER phrase: improved syntax checks (see bug #442).

@item
RECORD KEY clause: implemented sparse keys (SOURCE IS; feature request #23).
@end itemize


@item
Data division
@itemize @bullet

@item
88-level items: improved error messages when used in the wrong places.

@item
ANY LENGTH clause: fixed bug #487, where literals moved to ANY LENGTH items were incorrectly truncated.

@item
ANY LENGTH clause: fixed bug #511, where comparisons treated ANY LENGTH items as having just one character.

@item
ANY LENGTH clause: fixed segfault when referencing linkage-section ANY LENGTH items in the first compiled program.

@item
COLUMN clause: ``COL +1'' and similar clauses are no longer allowed; there must now be a space between the sign and the number.

@item
COLUMN clause (screen): added POS as synonym for COLUMN.

@item
LINE clause: ``LINE +1'' and similar clauses are no longer allowed; there must now be a space between the sign and the number.

@item
LINE clause (report): allow LINES instead of LINE.

@item
PICTURE clause: added recognition of PIC 1(n).

@item
PICTURE clause: improved error messages.

@item
PICTURE clause: added recognition of LOCALE phrase.

@item
RECORD VARYING clause: fixed bug #441, where an FD could be declared as RECORD VARYING, but have records of only one size.

@item
Screen section: made some COBOL words context-sensitive to screen section.

@item
Screen description: the rules on which clauses must be specified when now depend on the dialect (see bug #382).

@item
SYNCHRONIZED clause: deactivated RIGHT phrase, pending correct implementation (previously SYNCHRONIZED RIGHT was the same as SYNCHRONIZED LEFT).

@item
USAGE clause: added option to make COMP-1 mean a 16-bit signed integer (feature request #272).

@item
USAGE clause: added recognition of BIT and COMP-0.

@item
USAGE clause: added COMP-N.

@item
VOLATILE clause: added recognition of.
@end itemize


@item
Procedure division
@itemize @bullet

@item
ACCEPT statement (environment): added recognition of INPUT~STATUS and TERMINAL-INFO and SYSTEM-INFO phrases.

@item
ACCEPT statement (screen): fixed ACCEPT WITH UPDATE and not working (bug #423).

@item
ACCEPT statement (screen): fixed bug #426, where backspacing at the start of a field moved the cursor to the second-to-last character of the preceding field.

@item
ACCEPT statement (screen): added detection of CONTROL KEY clause.

@item
ACCEPT statement (screen): allow numeric-edited fields to contain spaces (see bug #491).

@item
ACCEPT statement (screen): fixed error when filling in a one character field with insert mode on (bug #498).

@item
ACCEPT statement (screen): pressing the home key, or end key, now toggles between going to the start of, or end of, the field and the cursor's original position.

@item
ACCEPT statement (screen): added WITH NO BELL clause.

@item
ACCEPT statement (screen): added support for Microsoft COBOL position specifiers.

@item
ACCEPT statement (temporal): fixed bug #469, where ACCEPT FROM DAY was off by $-1$.

@item
ALLOCATE statement: added recognition of LOC clause.

@item
CALL statement: fixed ON EXCEPTION not working properly with -fstatic (bug #462).

@item
CALL statement: added LINKAGE phrase (feature request #311).

@item
CANCEL statement: fixed segfault in recursive programs (bug #98).

@item
Conditions: strengthened syntax checks for abbreviated conditions.

@item
Conditions: improved error messages (bug #567).

@item
CONTINUE (after): added support for (from COBOL~202X draft standard). See feature request #354.

@item
DISPLAY statement (printer): allow for redirecting DISPLAY UPON PRINTER(-1) to files based on the runtime configuration.

@item
DISPLAY statement (screen): fixed DISPLAY LOW-VALUE not setting position of cursor for next DISPLAY statement (bug #423).

@item
DISPLAY statement (screen): added configuration option to disable Micro Focus' special behaviour with some figurative constants (see bug #423).

@item
DISPLAY statement (screen): fixed bug #428, where DISPLAY ALL ``x'' WITH SIZE only displayed ``x'' once.

@item
DISPLAY statement (screen): added support for Microsoft COBOL's position specifiers and ERASE phrase.

@item
ENTRY statement: added LINKAGE phrase (feature request #311).

@item
Error messages: runtime error messages now include ``error: '' after the file before the actual error message.

@item
EVALUATE statement: added partial support for WHEN clauses not containing any statements, which transfer control to the next WHEN clause containing a statement, if any (so the behaviour is like C's switch statement).

@item
Exceptions: the exception status is now only reset by SET LAST EXCEPTION TO OFF.

@item
Exceptions: fixed EC-SIZE-OVERFLOW being raised when EC-SIZE-ZERO-DIVIDE is active (bug #223).

@item
File I-O: fixed bug #457, where file status 30 was set instead of the correct permanent error status (34, 35 or 37).

@item
File I-O: added support for VBISAM 2.1.1.

@item
File I-O: error messages from libcob now include the file I-O statement that caused them, when known.

@item
Floating-point arithmetic: fixed incorrect SIZE ERROR exceptions (see bug #470).

@item
Floating-point arithmetic: fixed bug #478, where calculations with the SIZE ERROR phrase have different results to calculations without it.

@item
Floating-point arithmetic: now activate the SIZE ERROR handler when a floating-point variable is set to a non-finite value (see bug #122).

@item
INQUIRE statement: added recognition of.

@item
JSON GENERATE statement: added patch #45).

@item
JSON PARSE statement: added recognition of.

@item
LENGTH OF phrase: fixed error message when used on group fields (bug #175).

@item
LENGTH OF phrase: allow non-numeric literals.

@item
MODIFY statement: added recognition of.

@item
MOVE statement: added options to interpret moving non-numeric values to numeric items as moving zero to numeric items.

@item
MOVE statement: improved detection of overlapping MOVEs when using reference modification.

@item
MOVE statement: fixed remaining cases of bug #220, involving numeric-edited items.

@item
MOVE statement: fixed incorrect truncation of COMP-4 items.

@item
PERFORM statement: added check for non-zero item in BY phrase (feature request #268).

@item
PERFORM statement: allow the BY phrase to be omitted, which is the same as specifying BY 1 (feature request #158).

@item
PERFORM statement (inline): added partial support for inline PERFORM statements not containing any statements.

@item
Procedure division header: added recognition of MEMORY SIZE phrase.

@item
Procedure division header: added LINKAGE phrase (feature request #311).

@item
RAISE statement: added recognition of.

@item
Reference modification: improved out-of-bounds error message (bug #445).

@item
SORT statement: added sorting of tables without keys patch #42).

@item
SORT statement: added recognition of more COLLATING SEQUENCE phrases.

@item
OPEN statement: fail with file status 39 when the first record of an indexed file is larger than specified in the FD.

@item
OPEN statement: fixed segfault when attempting to open a file in a non-existent folder (bug #520).

@item
OPEN statement: added ACUCOBOL locking clauses.

@item
READ statement (indexed): fail with file status 43 when the read record is larger than specified in the FD.

@item
Reference modification: added warnings for invalid reference modifications involving variables.

@item
Report writer: implemented, including features from COBOL 2002 and the IBM Report Writer.

@item
REWRITE statement (indexed): now sets file status to 02 when duplicate key is detected.

@item
SET statement: fixed bug #225, where an invalid SET statement caused an error saying ``invalid MOVE statement''.

@item
STOP statement: fixed the NORMAL phrase causing a compilation error (bug #433).

@item
USE statement (exception): improved recognition of.

@item
VALIDATE statement: added recognition of.

@item
WRITE statement: fixed compilation error when writing to a GLOBAL file in a subprogram (bug #87).

@item
WRITE statement (indexed): now sets file status to 02 when duplicate key is detected.

@item
XML GENERATE statement: added patch #41.

@item
XML PARSE statement: added recognition of.
@end itemize


@item
Intrinsic functions
@itemize @bullet

@item
CONTENT-OF function: added.

@item
CONTENT-LENGTH function: added.

@item
LENGTH, BYTE-LENGTH and LENGTH-AN functions: now forbid numeric arguments.

@item
MOD function: fixed EC-SIZE-ZERO-DIVIDE being raised instead of EC-ARGUMENT-FUNCTION when zero was provided as an argument.

@item
REM function: fixed EC-SIZE-ZERO-DIVIDE being raised instead of EC-ARGUMENT-FUNCTION when zero was provided as an argument.

@item
X"91" function: corrected number of arguments from 2 to 3 (bug #527).

@item
WHEN-COMPILED function: fixed timezone, which was missing its sign and contained nonsense when negative (bug #436).
@end itemize


@item
Built-in subprograms
@itemize @bullet

@item
$GETPID: fixed wrong process ID being returned after forking (bug #451).

@item
$SLEEP: if the requested time is too large, sleep for the maximum possible time instead of not at all.

@item
CBL_READ_KBD_CHAR: this now works (bug #500).

@item
SYSTEM: added workaround of buggy system() implementation on Windows, which removes leading and trailing quotes.
@end itemize
@end enumerate
@iftex
@sp 3
@center -----------------------------------------------------------------------------
@center End of Appendix F2 Summary of Compiler Changes since 2009 and version v2.2
@end iftex
