Kednos PL/I for OpenVMS
Alphatm
Release Notes for Version 4.5 and Runtime Library
Version 4.4H
15.1 Corrected Compiler Errors
Corrected compiler errors are as follows:
- VAX PL/I Version 3.5 produced an incorrect result when both the
SELECT and WHEN clauses of a SELECT statement contained a substring
expression. Local memory for the first substring may have been
overwritten by the second substring. This error has been corrected in
DEC PL/I Version 4.0.
The code that produced an incorrect result
(the value 1 instead of the correct value of 2) is as follows:
p:procedure options(main);
dcl txt char(3);
dcl n_chars fixed binary(31);
dcl option fixed binary(31);
txt = 'NUM';
n_chars = 2;
SELECT (SUBSTR (txt, 1, n_chars));
WHEN (SUBSTR ('LOG', 1, n_chars)) option = 1;
WHEN (SUBSTR ('NUMBER', 1, n_chars)) option = 2;
OTHERWISE option = 0;
END;
put skip list ('Option is => ',option);
END;
|
- VAX PL/I bugchecks when trying to initialize arrays of areas with
one PL/I assignment. DEC PL/I has corrected this problem. The following
example shows the VAX PL/I behavior:
p: procedure options (main);
dcl array(10) area;
array = empty();
end;
|
To avoid this error, initialize arrays of areas by means of a DO
loop when using VAX PL/I.
15.2 Corrected Documentation Errors
The errors in this section have been corrected in the current version
of the documentation (DEC PL/I Version 4.0).
The VAX PL/I Version 3.5 user manual said on page 2-13 that all Error
and Warning error messages are counted toward the error limit. VAX PL/I
and DEC PL/I do not count Warning messages, only Error messages, toward
the error limit.
The PL/I Reference Manual for VAX VMS and RISC ULTRIX
contained an error on the description of the LTRIM and RTRIM built-in
functions. The definition in that manual for LTRIM(s,[b]) states that
LTRIM removes blanks from the left of string s; or if b is supplied,
removes string b from the left of string s. The correct definition of
LTRIM(s,[b]) is that LTRIM removes white space from the left of string
s; or if b is supplied, removes string b from the left of string s. The
definition in the manual of RTRIM(s,[b]) states that RTRIM removes
blanks from the right of string s; or if b is supplied, removes string
b from the right of string s. The correct definition of RTRIM(s,[b]) is
that RTRIM removes white space from the right of string s; or if b is
supplied, removes string b from the right of string s. White space
characters are defined as blank, tab, newline, carriage return,
vertical tab, and formfeed.
16 Known Problems and Restrictions With Version 4.1
This section describes known problems with DEC PL/I Version 4.1, and
known ways to avoid the problems.
- Problem: Array bounds violations are not detected at run-time even
with /CHECK enabled.
Workaround: Check that code does not exceed
boundaries at compile time.
- Problem: Block I/O's of greater than 32K fail. Blocks I/O's of 64k
are supported on the VAX version
Workaround: Check that block I/O's
do not exceed the 32k limitation.
17 Known Problems and Restrictions With Version 4.0
This section describes known problems with DEC PL/I Version 4.0.
Because DEC PL/I Version 4.0 is based on VAX PL/I Version 3.5, Digital
recommends that you read the VAX PL/I Version 3.5 release notes before
submitting an SPR.
17.1 Compiler Known Errors and Methods of Avoidance
Known compiler errors and suggestions for avoiding them are as follows:
- In VAX PL/I and DEC PL/I, you can use the OTHERWISE option on a
GOTO statement that transfers control to a label-reference that is a
subscripted label with a variable subscript. An error is reported if
you use the OTHERWISE option on a GOTO statement for a label-reference
that is a subscripted label without a variable subscript. The
latter construct is not recommended, because it causes the compilers to
bugcheck. An example of such an inappropriate use of the OTHERWISE
option follows:
program: procedure options(main);
goto part(2) otherwise;
part(2):
end program;
|
To avoid this error, use a variable subscript or remove the
OTHERWISE option.
- When you use the GOTO statement with the OTHERWISE option, specify
label array elements after the GOTO statment. If you use potential
label references for a specific GOTO statement prior to the GOTO
statement the compiler bugchecks. An example of a program with such a
construct follows:
program: procedure options(main);
dcl i fixed binary(31,0);
part(1):
i = 2;
goto part(i) otherwise;
end program;
|
To avoid this error, place the label references for a specific
OTHERWISE option after the GOTO statement.
- CHARACTER(*) Stack Usage
Temporary stack space allocated for
return values from routines returning CHARACTER(*) is not deallocated
until the calling routine exits. The restriction is related to
determining the lifetime of the temporary value. A sample code segment
displaying this restriction follows:
DO I = 1 TO 1000;
CHARACTER_STRING = ROUTINE_RETURNING_CHAR_STAR();
END;
|
In this situation, the temporary storage for the return value is
not deallocated until the calling routine exits, which results in
considerable stack usage. A means of avoiding this restriction is to
enclose the use of the routine in a BEGIN block. For example:
DO I = 1 TO 1000;
BEGIN;
CHARACTER_STRING = ROUTINE_RETURNING_CHAR_STAR();
END;
END;
|
Although this method is slightly more CPU-intensive because of the
extra CALL/RETURN sequence, it causes the stack top to be correctly
reset between each iteration of the loop.
- Silent underflow during compilation
The compiler silently
replaces an underflowing floating-point constant with 0.0 during
compilations.
- Descriptors for picture variables
Picture variables are always
passed (incorrectly) by class NRO descriptors regardless of the format
of the picture variable. This problem may be addressed in a future
release of DEC PL/I.
- The compiler can now handle records up to 32K, which is the RMS
maximum. After a file is opened, a buffer equal to the longest record
length is allocated. This buffer is then used when the record is read.
This change is highly dependent on obtaining the longest record
length value for a file from RMS (using the xab$w_lrl field of fhc_xab
block) when the file is opened. However, rare cases exist in which RMS
fails to provide a correct value in that field. If this occurs, the
compiler issues the error message %PLIG-F-READERR, which is followed by
the operating-system message -RMS-F-USZ, invalid user buffer size.
One alternative is to edit the source file and write out a new version,
causing RMS to update the lrl value in the file header.
The
compiler issues the error message LOCNEED when the SIZE function
references a based variable declared without an associated pointer. For
example:
TEST: PROC OPTIONS (MAIN);
DCL 1 RECORD BASED,
3 ITEM1 CHAR(10),
3 ITEM2 CHAR(20);
PUT EDIT (SIZE(RECORD)) (F(5)); /* %PLI-E-LOCNEED */
END;
|
- The compiler issues an incorrect error message when initializing
an array through a pointer using an asterisk (*) as an array subscript.
The following example illustrates the problem:
test: procedure options (main);
dcl 1 tmp1 based,
2 tmp2 fixed,
2 tmp (20) bit (17 refer (tmp2) ),
2 tmp3 fixed;
dcl (mptr,mptr2) pointer;
dcl tmp4 (4) bit (10) based;
allocate tmp1 set (mptr);
allocate tmp4 set (mptr2);
mptr->tmp2 = 17;
mptr->tmp3 = 15;
mptr->tmp1.tmp(*) = '10000000001000010'b; /* does not work */
put skip list (mptr->tmp1);
mptr2->tmp4(*) = '1000000000'b; /* does not work */
put skip list (mptr2->tmp4);
end;
|
The error message received is:
%PLIG-E-INVSTAREXT, An asterisk is not a valid subscript or
argument.
|
The alternative is to initialize the array by means of a DO loop.
- VAX PL/I and DEC PL/I compilers bugcheck when trying to pass an
asterisk (*) as an argument using the REFERENCE or VALUE built-in
functions (BIFs). The problem is caused by a function added to Version
3.5 which allows you to use asterisk subscripts when referencing an
entire array.
The compilers report the following error:
%PLIG-E-INVSTAREXT, An asterisk is not a valid subscript or
argument.
|
Also if the asterisk is passed directly as an argument without
using the BIFs, the compilers issue an incorrect error message:
%PLIG-E-TOOFEWARG, "Entity" has been referenced with too few
arguments.
|
If you pass the asterisk using the DESCRIPTOR built-in function,
the compilers again issue the wrong error message, as follows:
%PLIG-E-DESCRIBIF, Invalid use of the DESCRIPTOR built-in
function.
|
The compilers should issue the following message in both cases:
%PLIG-E-INVSTAREXT, An asterisk is not a valid subscript or
argument.
|
The following example is a sample of the code to which the
compilers respond incorrectly:
p: procedure;
dcl e entry (fixed);
call e (reference(*));
end;
|
- The DEC PL/I and VAX PL/I compilers bugcheck if you use an
asterisk as a label array subscript, if the variable you use as a
subscript for a label array in a GOTO statement is not declared, and if
a corresponding label array includes an asterisk. The following PL/I
program illustrates the problem:
bug: procedure;
goto case1(x);
case1(1):;
case1(*):;
end;
|
Instead, declare the variable explicitly.
- The DEC PL/I compiler sometimes generates an incomplete
informational message for PL/I structure variables that are
self-referencing. The compiler generates the message when you use the
/DEBUG/OPTIMIZE qualifiers. The following PL/I program illustrates the
problem.
program: PROCEDURE;
DCL A_CURDB EXTERNAL POINTER;
DCL 1 DBCMN BASED ( A_CURDB ),
2 DBTMAX FIXED BIN (15) ;
DCL LEAF_PTR PTR;
DCL 1 LEAF BASED ( LEAF_PTR ),
2 LEAF_COUNT FIXED BIN (15),
2 ENTRY ( LEAF.LEAF_COUNT ),
3 KEY FIXED BIN (15);
END PROGRAM;
|
The message that you receive does not contain the name of the
noninitialized fetch. In this case it is "LEAF.LEAF_COUNT." The message
that you receive is:
END PROGRAM;
^
%PLIG-I-UNINIT, variable is fetched, not initialized
|
17.2 Run-Time Library Known Errors and Methods of Avoidance
These release notes for DEC PL/I for OpenVMS AXP Version 4.0 include
release notes for the OpenVMS AXP Run-Time Library (RTL), as the DEC
PL/I for OpenVMS AXP Version 4.0 kit that you receive contains a
special version of the Run-Time Library (in the DPLIVMS040 file). In
future releases, OpenVMS AXP will supply the RTL, as it has in the
past, and RTL release notes will be included with the OpenVMS AXP
release notes.
Information in this section is listed by operating-system version:
OpenVMS AXP Version 1.5
- Environment Option FILE_ID_TO
This option is supported only
for temporary files. In addition, the option does not work if the
default directory specification is a rooted directory. Digital is
unlikely to change this behavior, because this option's rate of use is
low. If this restriction constitutes a serious problem for you, please
submit an SPR.
- PL/I FINISH condition and DEBUG
In VAX PL/I, the EXIT command
to the debugger raises the FINISH condition and issues a message that
the debugger is finishing. DEC PL/I does not raise the FINISH condition
due to architectural differences between OpenVMS VAX and OpenVMS AXP.
17.3 Known Errors in the PL/I for OpenVMS Systems Documentation
The known errors in the PL/I for OpenVMS OpenVMS documentation are as
follows:
- PL/I for OpenVMS Systems Reference Manual
The title
page (the manual accompanying DEC PL/I for OpenVMS AXP Version 4.0)
states that the version of the OpenVMS AXP operating system for DEC
PL/I is OpenVMS AXP Version 1.5 or higher. This is incorrect. The
correct information is OpenVMS AXP Version 1.5.
Information in
Section D.2, Differences Between VAX PL/I and DEC PL/I, is more current
in Section 15 of these release notes.
- PL/I for OpenVMS Systems User Guide
Figures 10-6 and
11-1 are true for the OpenVMS VAX operating system but not for the
OpenVMS AXP operating system, as the manual states. Please see the
OpenVMS Calling Standard manual (order number AA-PV69A) for
the equivalent OpenVMS AXP information. The Calling Standard manual is
a component of the Programmer's Kit in the OpenVMS AXP documentation
set.
Example 10-8 is true for OpenVMS VAX only, as the manual
states. The OpenVMS AXP equivalent is as follows:
Example 1-||Displaying Arguments Passed to a
Condition Handler (AXP) |
%INCLUDE $CHFDEF; (1)
DECLARE X FIXED;
CHF$ARGPTR = ONARGSLIST(); (2)
/* Output number of signal arguments */
PUT SKIP LIST('Signal Arg Count',CHF$SIG_ARGS); (3)
/* Output condition name argument and rest of signal arguments */
PUT SKIP LIST('Condition name', CHF$SIG_NAME); (4)
PUT SKIP LIST(DIM(CHF$SIG_ARG,1),
'additional arguments:'); (5)
DO X = 1 TO DIM(CHF$SIG_ARG,1);
PUT SKIP LIST(CHF$SIG_ARG(X));
END;
/* Output RO and R1 */
PUT SKIP(2) LIST('Low Order 32 bits RO:',CHF$IL_MCH_SAVRO_LOW); (6)
PUT SKIP(2) LIST('High Order 32 bits RO:',CHF$IL_MCH_SAVRO_HIGH);
PUT SKIP(2) LIST('Low Order 32 bits R1:',CHF$IL_MCH_SAVR1_LOW);
PUT SKIP(2) LIST('High Order 32 bits R1:',CHF$IL_MCH_SAVR1_HIGH);
END;
|
The following notes are keyed to Example 1:
- The procedure includes the module $CHFDEF from
the default system library.
- The ONARGSLIST built-in function assigns a
value to the pointer CHF$ARGPTR, declared in $CHFDEF.
- Using the CHF$SIG_ARGS field in the signal
array, the procedure prints the number of arguments in the signal array.
- It displays the contents of the first
argument, that is, the condition value.
- Because the number of arguments is variable,
the procedure uses the DIM built-in function to determine the number of
elements in the array CHF$SIG_ARG (this array always contains three
fewer members than arguments in the array, because the condition name,
PC, and PSL arguments are always present).
- After displaying the signal arguments, the
procedure displays the contents of R0 and R1 from the mechanism array.
For more detailed information on the argument lists passed to a
condition handler and for descriptions of the values in the signal
array and mechanism array, see the OpenVMS System Services Reference
Manual. Note that the PL/I run-time system signals conditions using the
conventions for specifying signal arguments. Specifically, it passes
arguments following the requirements described for the SYS$PUTMSG
procedure. This procedure is described in the Introduction to the VMS
Run-Time Library.
- On pages 2-7 and 2-11, in Section 2.32, the user manual incorrectly
states that the /DIAGNOSTICS qualifier to the PLI command is for the
OpenVMS VAX operating system only. This qualifier operates on both
OpenVMS VAX and OpenVMS AXP.