[Cobolforgcc-devel] SIZE ERROR with no SIZE ERROR specified in code
Status: Pre-Alpha
Brought to you by:
timjosling
From: Bill K. <wm...@ix...> - 2005-06-01 17:44:13
|
There is a difference between the '85 and '02 Standards for what happens when a "SIZE ERROR" condition occurs and no ON SIZE ERROR phrase is specified. From page 814 of the '02 Standard (list of substantive changes), "15) Size error condition with no SIZE ERROR phrase. If a size error condition occurs, the statement in which it occurs contains no SIZE ERROR or NOT SIZE ERROR phrase, and there is no associated declarative, the implementor defines whether the run unit is terminated or execution continues with incorrect values. Justification: In the previous COBOL standard, the rules for size error stated that execution would continue with undefined values, but it was not clear where execution would continue, particularly in conditional statements. Additionally, continued execution with incorrect results was not acceptable for many critical applications, where it might cause corruption of databases, incorrect continued execution of the program, and potentially a multitude of additional errors. It was prohibitive to modify programs to add ON SIZE ERROR for every affected statement. Responding to user requirements, several implementors terminated execution of the program in this situation; in some cases, the implementor allowed selection of termination based on a compiler directive. The number and criticality of applications that terminated in this situation provides strong justification for this change. It is expected that this change will have little impact on existing programs because implementors are free to continue or terminate, in accordance with their implementation of the previous COBOL standard." NOTE WELL: To test how your (non-OC) COBOL compiler works, check out a DIVIDE-BY-ZERO with no ON SIZE ERROR specified. |