pTAL Guidelines for TAL Programmers
Differences Between TAL and pTAL
pTAL Guidelines for TAL Programmers—527256-002
3-23
OVERFLOW_TRAPS Procedure Attribute
An OVERFLOW_TRAPS procedure attribute overrides an OVERFLOW_TRAPS
directive. A block-level ENABLE_OVERFLOW_TRAPS attribute overrides a
procedure-level OVERFLOW_TRAPS attribute as well as an OVERFLOW_TRAPS
directive.
OVERFLOW_TRAPS Procedure Attribute
In pTAL, you can use the OVERFLOW_TRAPS and NOOVERFLOW_TRAPS
procedure attributes to enable or disable traps for a procedure. These attributes
specify the default overflow trapping behavior for the procedure or subprocedure with
which they appear and override the OVERFLOW_TRAPS directive in effect.
In TAL, you can use the OVERFLOW_TRAPS and NOOVERFLOW_TRAPS attributes,
but they do not ensure the trapping characteristics of your program. In TAL, these
procedure attributes do not affect the object code generated by TAL except at the end
of a BEGIN-END block. See ENABLE_OVERFLOW_TRAPS Block Attribute on
page 3-24 for more details.
For the source code in the Example 3-15 on page 3-23, the object code produced by:
•
The native compiler:
°
Disables traps for procedure x
°
Disables traps for procedure y
°
Enables traps for subprocedure s
°
Disables traps upon reaching the END at the end of subprocedure s
•
The TAL compiler disables traps upon reaching the END at the end of
subprocedure s.
Example 3-15. OVERFLOW_TRAPS and NOOVERFLOW_TRAPS Procedure
Attributes
PROC x(i) NOOVERFLOW_TRAPS;
INT i;
BEGIN
...
END;
PROC y(i) NOOVERFLOW_TRAPS;
INT i;
BEGIN
SUBPROC s OVERFLOW_TRAPS;
BEGIN
...
END;
i := 0;
END;