DEC Pascal V5.5-48 for Digital UNIX Systems Release Notes 14 March 1996 This document contains information about DEC Pascal V5.5-48 including new features, and other topics. This file is of interest to both system management and application programmers. CONTENTS CHAPTER 1 DEC PASCAL V5.5-48 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES 1.1 Overview Of DEC Pascal . . . . . . . . . . . . . . 1-1 1.2 New Features In DEC Pascal . . . . . . . . . . . . 1-1 1.2.1 Run-Time Library Now Thread-safe . . . . . . . . 1-2 1.2.2 Enhanced Optimization And Code Generation . . . 1-2 1.2.3 Improved Debug Support With DBX . . . . . . . . 1-2 1.2.4 Pc Command Now Accepts "-threads" . . . . . . . 1-2 1.3 DEC Pascal Run-Time Library And The QUADRUPLE Datatype . . . . . . . . . . . . . . . . . . . . . 1-3 1.4 Known Problems And Restrictions . . . . . . . . . 1-3 1.4.1 Debugger Issues . . . . . . . . . . . . . . . . 1-6 1.5 Documentation Errors . . . . . . . . . . . . . . . 1-6 1.5.1 Updating The Whatis Database . . . . . . . . . . 1-7 1.5.2 Use Of [ENVIRONMENT] Attribute Without A Filename . . . . . . . . . . . . . . . . . . . . 1-7 1.5.3 UNSIGNED8 And UNSIGNED16 Predeclared Subranges . 1-8 1.6 Compiling For Optimal Performance . . . . . . . . 1-8 1.7 DEC Pascal Run-Time Library Support Routines . . . 1-8 1.8 Exception Handling On Digital UNIX . . . . . . . . 1-9 1.9 Migrating DEC Pascal Programs . . . . . . . . . . 1-9 1.9.1 Migrating From RISC ULTRIX Systems To Digital UNIX Systems . . . . . . . . . . . . . . . . . . 1-9 1.9.2 Migrating From OpenVMS Systems To Digital UNIX Systems . . . . . . . . . . . . . . . . . . . 1-12 1.9.2.1 Sharing Environment Files Across Platforms . 1-12 1.9.2.2 Default Size For Enumerated Types And Booleans . . . . . . . . . . . . . . . . . . 1-12 1.9.2.3 Default Data Layout For Unpacked Arrays And Records . . . . . . . . . . . . . . . . . . 1-12 1.9.2.4 IADDRESS And VOLATILE . . . . . . . . . . . 1-13 1.9.2.5 INT On Large Unsigned Numbers Now Overflows 1-13 1.9.2.6 Bound Procedure Values . . . . . . . . . . . 1-13 1.9.2.7 Argument List Functions . . . . . . . . . . 1-14 1.9.2.8 %DICTIONARY Directive . . . . . . . . . . . 1-14 1.9.2.9 VAX Floating Datatypes . . . . . . . . . . . 1-14 1.9.2.10 Relative And Indexed Files . . . . . . . . . 1-14 1.9.3 Calling C Routines From Pascal . . . . . . . . 1-15 1.10 Problems Corrected Since Last Release Of DEC Pascal . . . . . . . . . . . . . . . . . . . . . 1-16 CHAPTER 1 DEC PASCAL V5.5-48 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES 1.1 Overview Of DEC Pascal DEC Pascal V5 is a major release of the DEC Pascal language. The major new features of DEC Pascal V5 are: 1. New platform support. DEC Pascal now supports OpenVMS Alpha and Digital UNIX systems as well as continued support for OpenVMS VAX systems. 2. New functionality to be more compatible with UNIX -based Pascals (ie, Pascal for RISC on the RISC/ULTRIX platforms). 3. New functionality to efficiently use the Alpha architecture from DEC Pascal. DEC Pascal V5.5-48 requires Digital UNIX V3.0 or later. 1.2 New Features In DEC Pascal DEC Pascal V5.5 does not contain any new language features. It does contain: 1. Bug fixes 2. Run-Time Library Now Thread-safe 3. Enhanced optimization and code generation 4. Improved debug support with dbx 5. pc command now accepts "-threads" DEC PASCAL V5.5-48 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES 1.2.1 Run-Time Library Now Thread-safe The DEC Pascal Run-Time Library has been enhanced to work properly with DECthreads. In previous versions, the library would generate spurious errors when trying to close files or exit the program. 1.2.2 Enhanced Optimization And Code Generation DEC Pascal V5.5 contains a newer version of the GEM code generator that includes better optimizations and code generator. Previously, optimization level 5 included software pipelining. Starting with V5.5, level 5 also contains support for 1. Loop blocking 2. Loop distribution 3. Loop fusion 4. Loop interchange 5. Loop scalar replacement 6. Outer loop unrolling During field test, we would like you to test with optimization level 5 as much as possible. Level 5 is not the default since under certain conditions, the generated code may be slower than level 4. 1.2.3 Improved Debug Support With DBX DEC Pascal V5.5 contains improved debug support with dbx. However, to take advantage of most of these improvements, you also need to be running Digital UNIX V4.0 or later as most of the improvements also required changes to dbx. Almost all areas of Pascal language support have been improved. 1.2.4 Pc Command Now Accepts "-threads" The pc command now properly handles the "-threads" option. When placed as the last option on a pc command, the driver will link with the appropriate libraries to work with DECthreads. DEC PASCAL V5.5-48 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES 1.3 DEC Pascal Run-Time Library And The QUADRUPLE Datatype The run-time library has been enhanced to include entry points for reading and writing QUADRUPLE values. If you plan to move applications that use QUADRUPLEs to other systems, you need to install the new RTL on those system as well. To do this, just install the DPOxxx kit on the systems and chose the RTL subset. The QUADRUPLE support will be merged into the RTL bundled on the base CDROM in a future release of Digital UNIX. 1.4 Known Problems And Restrictions Here is a list of language features that are not yet implemented or do not work as documented in DEC Pascal for Digital UNIX Systems. 1. Using Discriminated Schema as Formal Discriminant Types Extended Pascal allows a discriminated ordinal schema type to be subsequently used as the type of a formal schema discriminant. For example, TYPE SUBR(L,U:INTEGER) = L..U; DSUBR = SUBR(expression,expression); SCH1(D:DSUBR) = ARRAY [1..D] OF INTEGER; SCH2(D:DSUBR) = RECORD CASE D OF 1: (F1:INTEGER); 2: (F2:CHAR); END; DEC Pascal does not currently support this construct. 2. Files with Schema Components Extended Pascal allows file components to contain schematic items and therefore provide run-time sized file components. For example, TYPE SUBR(L,U:INTEGER) = L..U; FILE_COMP = ARRAY [SUBR(expr,expr)] OF INTEGER; VAR F : FILE OF FILE_COMP; DEC Pascal does not currently support this feature and requires that the component sizes of files be known at compile-time. 3. Using Formal Discriminants Inside Initial State Specifiers Extended Pascal allows the formal discriminant to appear in DEC PASCAL V5.5-48 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES an initial state specifier in the schema definition. For example, TYPE R(D:INTEGER) = RECORD F1 : INTEGER VALUE D; END; A(D:INTEGER) = ARRAY [1..D] OF INTEGER VALUE [OTHERWISE D]; DEC Pascal does not currently support this feature and requires that all initial state values be compile-time expressions. 4. Changing Variants When Selector Is A Discriminant If a formal discriminant is used as a variant tag, it is illegal to change the variant once the variable has been created. For example, TYPE R(D:INTEGER) = RECORD CASE D OF 1: (ONE : INTEGER); 2: (TWO : INTEGER); OTHERWISE (OTHERS : BOOLEAN); END; VAR V : R(1); BEGIN V.TWO := 2; { Is illegal since it changes variants from 1 to 2 } END; DEC Pascal does not currently generate run-time checking code to detect this violation. 5. The AND_THEN and OR_ELSE Boolean operators do not short-circuit when used in constant expressions. All constant expressions currently do full evaluation in a left-to-right order. For example, CONST X = FALSE AND_THEN (1 DIV 0 = 0); This example will currently generate a compilation error instead of correctly definiting the constant X to be the value FALSE. 6. The DEC Pascal compiler currently allows you to use the SIZE function on TIMESTAMP variables. As in the case for file variables, these types are abstract objects and the compiler should not permit assumptions about their size to be used. 7. When the buffer variable of a file is passed as a VAR parameter, the allocation size of the formal VAR parameter DEC PASCAL V5.5-48 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES must match that of the components of the file. Failure to do so will result in an Internal Compiler Error. For example: PROGRAM A; VAR F : PACKED FILE OF 0..65535; G : FILE OF [WORD] 0..65535; PROCEDURE P( VAR I : INTEGER ); EXTERNAL; BEGIN P(F^); { causes an Internal Compiler Error } P(G^); { causes an Internal Compiler Error } END. 8. The standard file variable ERR is not yet supported. 9. The MESSAGE builtin is not yet supported. 10. Jumping into a WITH statement with a GOTO statement may result in an Internal Compiler Error if compiled with /OPTIMIZE. Such programs are illegal in nature as bypassing the prologue of the WITH statement skips around the code that precomputes the address of the record used in the WITH statement. 11. The ALIGNED attribute only allows upto 8192 byte boundaries at present (ie, ALIGNED(13)). Support for larger alignments will be provided in a future release. 12. The UNDEFINED predeclared routine is not yet supported. 13. When a real constant that is less than MINREAL is specified to the DEC Pascal for OpenVMS Alpha Systems compiler or the DEC Pascal for Digital UNIX compiler, a compile time error message is generated. This behavior is different than that of DEC Pascal for VAX Systems, which quietly accepts the real number as 0.0. 14. Incomplete support for INTEGER64/UNSIGNED64; Currently, the following uses of the INTEGER64/UNSIGNED64 datatypes are unsupported: a) Literals requiring more than 32-bits cannot be used in the declaration section. This implies that you cannot write such things as: CONST BigNum = 12345678912345678; but you CAN write things such as: DEC PASCAL V5.5-48 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES i64 := 12345678912345678; b) INTEGER64/UNSIGNED64 expressions cannot be used as case selectors or variant record tags. c) Subranges requiring more than 32-bits cannot be declared (since you cannot specify literals large enough to construct them). d) Array index types cannot be INTEGER64/UNSIGNED64 (since you cannot specify subranges of them). e) Certain builtin routines do not yet support INTEGER64/UNSIGNED64 items (such as LOWER, UPPER, MIN, and MAX). f) The predeclared constants MAXINT64 and MAXUNSIGNED64 are not present. g) INTEGER64/UNSIGNED64 types cannot be used in variable typecasts. 15. The compiler does not automatically close local files when the declaring routine returns. This will be fixed in a future release. 1.4.1 Debugger Issues The compiler does not produce correct debug information for the following data/variable types: 1. Schematic variables (except the predefined type STRING) 2. Conformant varying parameters 3. Conformant parameters Proper debug information will be generated for these data types in a future release of DEC Pascal. 1.5 Documentation Errors DEC PASCAL V5.5-48 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES 1.5.1 Updating The Whatis Database The DEC Pascal for Digital UNIX Systems Installation Guide omitted instructions on how to update the /usr/share/man/whatis database used with the whatis(1) command. After installation of the DEC Pascal documentation subset (DPOMANnnn), invoke the catman(1) program from the root account with the -w flag. For example, # catman -w 1.5.2 Use Of [ENVIRONMENT] Attribute Without A Filename In the DEC Pascal User Manual for Digital UNIX Systems, the behavior of the compiler when the [ENVIRONMENT] attribute is used without a filename is described incorrectly. If you do not specify a filename with the [ENVIRONMENT] attribute, then the filename of the source file is used with a ".pen" extension for the name of the environment file. For example, { Module share_data.pas } [ENVIRONMENT] Module Share_Data; CONST Rate_For_Q1 = 0.1211; Rate_For_Q2 = 0.1156; END. The above module, when compiled, would result in the creation of an environment file named "share_data.pen". If a filename is specified with the [ENVIRONMENT] attribute, then that filename is used as-is in creating the environment file. The [INHERIT] attribute will cause the compiler to first attempt to open a file with the exact filename that is supplied. If this fails, an extension of ".pen" is added to the filename specified and the open is retried. For example, { Program inherit_example.pas } [INHERIT ('share_data')] DEC PASCAL V5.5-48 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES Program inherit_example(output); CONST My_Rate = Rate_For_Q1*2.0; BEGIN Writeln(My_Rate) END. When the program above is compiled, the compiler first attempts to open the file 'share_data' as an environment file. If 'share_data' is not found the compiler attempts to open 'share_data.pen' as an environment file. If 'share_data.pen' is not found an error message is issued and the compilation is stopped. 1.5.3 UNSIGNED8 And UNSIGNED16 Predeclared Subranges The UNSIGNED8 and UNSIGNED16 predeclared subrange types are documented as being subranges of UNSIGNED. However, they are actually subranges of INTEGER with positive values that correspond to an UNSIGNED subrange of the same size. This subtle distinction in the definition is almost impossible to detect from a program and shouldn't be a problem in the general case. We are considering changing the definitions of UNSIGNED8 and UNSIGNED16 to be true subranges of UNSIGNED in a future release. Such a change will not invalidate existing programs. 1.6 Compiling For Optimal Performance The following command line will result in producing the fastest code from the compiler. pc -nozero_heap -math_library fast -O5 You may also want to use the new performance flagger to identify datatypes that could be modified for additional performance. 1.7 DEC Pascal Run-Time Library Support Routines The following routine has been added to libpas.a/libpas.so to enable a program to determine the C file variable that is used to implement a Pascal file variable. The routine is: function pas$c_file_variable( var f : text ) : pointer; external; This routine will return the address of the C file variable used to implement the specified Pascal file variable. The file must already DEC PASCAL V5.5-48 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES be opened before the routine can be called. 1.8 Exception Handling On Digital UNIX To support the ESTABLISH and REVERT builtins, non-local GOTOs, and to signal and print run-time error messages, the DEC Pascal run-time library (libpas) uses the stack-based exception handling mechanism. See "man exception_intro" for more information. At the beginning of any program that uses the Pascal run-time library, the library does the following: 1. Registers the EXC_Raise_Signal_Exception routine as a signal handler for the SIGTRAP and SIGFPE signals using sigaction(). 2. Registers a private last-chance handler with EXC_Set_Last_Chance_Handler(). If your program registers its own signal handlers for SIGTRAP or SIGFPE; or registers a different last-chance handler, then errors signalled at run-time may not produce the expected run-time messages and language handlers may not be called to handle the error. Other language features, such as non-local GOTOs, should continue to work as expected. In addition, the special last-chance handler is only used when the main program is not written in Pascal. 1.9 Migrating DEC Pascal Programs 1.9.1 Migrating From RISC ULTRIX Systems To Digital UNIX Systems For users who are migrating from Pascal for RISC on the RISC/ULTRIX DECstations, the new features are all those features from the VAX Pascal product that don't exist in Pascal for RISC. The list is too long to include here. However, it includes run-time sized types and variables, a true separate compilation mechanism, variable length strings, compiler attributes (aka pragmas), etc. See the DEC Pascal documentation for more information. 1. Pascal for RISC and DEC Pascal implement different Pascal language features. The following list enumerates differences you will see when compiling a Pascal program written for Pascal for RISC using DEC Pascal for Digital UNIX Systems. a) The Pascal for RISC independent compilation feature is not supported in DEC Pascal. DEC Pascal provides independent compilation via environment files, see the DEC PASCAL V5.5-48 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES DEC Pascal Language Reference Manual for more information. b) The Pascal for RISC NULL statement is not supported in DEC Pascal. c) The Pascal for RISC syntax for modifying the default alignment rules for record fields is not supported in DEC Pascal. DEC Pascal provides the POS and ALIGNED attributes to implement this feature. See the DEC Pascal Language Reference Manual for more information on the POS and ALIGNED attributes. d) The default integer size can be changed to 16 bits using the Pascal for RISC switch "-apc". The default integer size cannot be changed in DEC Pascal. e) The Pascal for RISC type conversion routines ALFA, BOOLEAN, CHAR, CARDINAL, DOUBLE, INTEGER, INTEGER16, INTEGER32, and REAL are not provided by DEC Pascal. f) The maximum length of identifiers in Pascal for RISC is 32 characters, in DEC Pascal identifiers can be up to 31 characters in length. g) Pascal for RISC allows certain negative numbers in SETs. DEC Pascal only allows positive numbers in SETs. h) Pascal for RISC allows up to 512 items in an INTEGER or CARDINAL SET. DEC Pascal only allows up to 255 elements in an INTEGER or UNSIGNED SET. i) Pascal for RISC writes the value of enumerated types in lower case. DEC Pascal writes them in upper case. j) Pascal for RISC has different default field widths than DEC Pascal. k) Pascal for RISC defines the type CHAR as being the subrange 0..127 when used as a base-type. DEC Pascal allows the full subrange 0..255 when CHAR is used as a base-type. l) Pascal for RISC and DEC Pascal may flag different variables and routines as uninitialized and unused since different algorithms are used by the two compilers to ascertain this information. m) The Pascal for RISC definition and syntax for type-casting is different from the DEC Pascal definition for type-casting. See the DEC Pascal Language Reference Manual for more information in type-casting in DEC DEC PASCAL V5.5-48 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES Pascal. n) The Pascal for RISC command options -w, -stdiso, -stdansi, are provided by the DEC Pascal switches -nowarn, -std ansi, and -std iso. o) The Pascal for RISC command option -casesense is not supported. Mixed case names are provided by DEC Pascal attributes on routine and variable names. p) The Pascal for RISC command options -j, -EB, -EL, -H_c, -#, -W_c, -t, -B, -h, -ko , -k, -S, -Olimit are not supported by DEC Pascal. 2. There are behavioral and implementation differences between Pascal for RISC and DEC Pascal V5.0. The following list enumerates the differences you might see at run-time when running code compiled by DEC Pascal for Digital UNIX Systems. a) Pascal for RISC always short-circuits the AND and OR boolean operators. DEC Pascal only guarantees short-circuiting for the AND_THEN and OR_ELSE boolean operators. b) Pascal for RISC determines REAL vs. DOUBLE precision constants based on their use. DEC Pascal provides a mechanism for specifying constants that are DOUBLE precision, see the DEC Pascal Language Reference Manual for more details. By default, all floating constants are of type REAL in DEC Pascal. c) Pascal for RISC uses a "non-zero" value for the ordinal value of TRUE. DEC Pascal will only store a 1 into boolean variables for a TRUE value. Non-Pascal code passing boolean arguments to DEC Pascal could notice behavior differences if even numbers (2,4,6...) were placed into boolean variables to signify TRUE, DEC Pascal will treat even values as FALSE since the low order bit is not set. d) Pascal for RISC supports the STLIMIT procedure. DEC Pascal will recognize STLIMIT but will not count executed statements or generate a run-time error when STLIMIT is called. e) Pascal for RISC trims trailing blanks from strings when printed with a field width of 0. DEC Pascal follows the Pascal standard, which dictates that strings printed with a field width of 0 print no characters. DEC PASCAL V5.5-48 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES f) Pascal for RISC left justifies output when negative field widths are used. DEC Pascal treats negative field widths as runtime errors. 1.9.2 Migrating From OpenVMS Systems To Digital UNIX Systems The following sections describe issues which affect DEC Pascal programs being moved from OpenVMS systems to Digital UNIX systems. 1.9.2.1 Sharing Environment Files Across Platforms The compiler will only inherit environment files created from a compiler for the same target platform. For example, you cannot inherit environment files generated on an OpenVMS VAX system with the DEC Pascal for Digital UNIX compiler. 1.9.2.2 Default Size For Enumerated Types And Booleans The default size for enumerations and Booleans in unpacked structures is longword on Digital UNIX systems. On OpenVMS VAX systems, the default is a byte for Booleans and small enumerations or word for larger enumerations. If you need the OpenVMS VAX behavior on Digtal UNIX systems, you can use the -enumeration_size byte command qualifier, the [ENUMERATION_SIZE(BYTE)] attribute, or you can place individual [BYTE] or [WORD] attributes on the affected fields or components. The default for OpenVMS VAX compilers will remain /ENUMERATION_SIZE=BYTE for compatibility. 1.9.2.3 Default Data Layout For Unpacked Arrays And Records On Digital UNIX and OpenVMS Alpha systems, the default data layout is "natural" alignment. This means that record fields and array components are aligned on boundaries based on their size. For example, INTEGERs on longword boundaries, INTEGER64s on quadword boundaries, etc. On OpenVMS VAX systems, the default alignment rule is to allocate such fields on the next byte boundary. If you need the OpenVMS VAX behavior on Digital UNIX systems, you can use the -align vax command qualifier or the [ALIGN(VAX)] attribute. DEC PASCAL V5.5-48 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES 1.9.2.4 IADDRESS And VOLATILE The IADDRESS builtin assumes that its parameter is a VOLATILE variable, a VOLATILE parmeter, or a routine entry point. Unlike the ADDRESS builtin, the IADDRESS builtin does not issue a warning if the parameter does not have the VOLATILE attribute. On OpenVMS VAX systems, the DEC Pascal compiler would often allocate variables in such a way that they existed for the entire routine in which they were declared. In these situations, using the IADDRESS builtin to obtain the address of the variable worked as expected. Usually, the address was passed to a system service via an item list or something similar. On Digital UNIX systems, the DEC Pascal compiler is much more agressive with optimizating data layout on the stack. In the absence of a VOLATILE attribute, the compiler will allocate variables for the smallest possible duration. If the address is taken with IADDRESS, by the time the address is written into by a library routine, the variable may nolonger exist and the memory store would corrupt another variable. In summary, if the IADDRESS builtin is used on automatic variables or parameters, then the VOLATILE attribute must be used to ensure proper behavior. 1.9.2.5 INT On Large Unsigned Numbers Now Overflows On OpenVMS VAX, the INT builtin would accept large unsigned numbers and silently convert them into negative integers. During the addition of 64-bit integer types to DEC Pascal, it became apparent that this behavior was wrong. Now, when overflow checking is enabled, the INT builtin will signal a run-time error if its actual parameter cannot be represented as an INTEGER32 value. If you have a large unsigned value that you wish to convert to a negative integer, you must use a typecast to perform the operation. 1.9.2.6 Bound Procedure Values On OpenVMS VAX systems, a Bound Procedure Value is a 2-longword data structure holding the address of the entry point and a frame-pointer to define the nested environment. DEC Pascal expects one of these 2-longword structures for PROCEDURE or FUNCTION parameters. Additionally, a called routine needs to be aware when it receives a Bound Procedure Value versus a simple routine address. When passing a routine to a %IMMED formal routine parameter, DEC Pascal will pass the address of the entry point. DEC PASCAL V5.5-48 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES On Digital UNIX systems, a Bound Procedure Value is just a special type of procedure descriptor which invokes a hidden jacket routine which in turns initializes the frame-pointer and calls the real routine. Given this structure, a routine that is calling another routine indirectly does not need to do anything special for Bound Procedure Values. Likewise, passing routines by %IMMED (or asking for the IADDRESS of a routine) passes the address of a procedure descriptor just as if the %IMMED wasn't present. There is no direct way in DEC Pascal to obtain the actual code address of a routine since it isn't generally useful without the associated procedure descriptor. 1.9.2.7 Argument List Functions Since the Digital UNIX calling standard does not have architected method for determining an argument count, the ARGUMENT, ARGUMENT_LIST_LENGTH, and PRESENT builtin routines are not support on Digital UNIX systems. In addition, the [TRUNCATE] attribute is not support and the [LIST] attribute can only be used on external routine definitions. 1.9.2.8 %DICTIONARY Directive The %DICTIONARY directive is not supported on Digital UNIX systems. 1.9.2.9 VAX Floating Datatypes None of the VAX floating datatypes are supported on Digital UNIX systems (F_FLOAT, G_FLOAT, D_FLOAT, and H_FLOAT). In addition, the only the IEEE_FLOAT option to the [FLOAT()] attribute is supported. 1.9.2.10 Relative And Indexed Files Several keywords on the OPEN and CLOSE statement are not supported on Digtal UNIX systems. These include the DEFAULT; DISPOSITION := PRINT, PRINT_DELETE, SUBMIT, and SUBMIT_DELETE; SHARING; USER_ACTION; and RECORD_TYPE := STREAM, STREAM_CR keywords. In addition, the DELETE, FIND, FINDK, LOCATE, RESETK, UPDATE, and UNLOCK builtin routines are not supported. DEC PASCAL V5.5-48 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES 1.9.3 Calling C Routines From Pascal The calling sequence for Pascal parameters that are passed to C routines is documented in Chapter 6 in the "DEC Pascal User Manual for DEC Digtal UNIX Systems" manual. However, the documentation does not mention how to pass strings from Pascal to C routines. One method would be to use the newly added null-terminated string support routines (see the earlier section in these release notes). The other method is to use the existing Pascal mechanisms and decode the Pascal-specific descriptor passed to the C routines. Here is summary of the calling sequences used by Pascal for various parameters. Note that for parameters passed with value semantics, the compiler assumes that any data pointed to by the argument list or descriptors is not modified by the called routine. o For non-conformant parameters (both VAR and value semantics), a pointer to the variable (or expression) is passed. DEC Pascal does not pass any arguments by "immediate value" by default. If you want this behavior, you can place the [IMMEDIATE] attribute on the formal parameter definition or use the %IMMED foreign mechanism specifier on the actual parameter. o For conformant array parameters without a CLASS_S attribute (both VAR and value semantics), a pointer to a Pascal-specific descriptor is passed. The descriptor (subject to change) looks like: struct { long pointer-to-data long total-data-size long element-size long pointer-to-virtual-base (aka, A[0] pointer) long dim-1-lower-bound long dim-1-upper-bound long dim-1-stride } with the last 3 longs repeated for any additional dimensions. o For conformant array parameters with a CLASS_S attribute (both VAR and value semantics), a pointer to a Pascal-specific descriptor is passed. The descriptor (subject to change) looks like: struct { long pointer-to-data long data-size DEC PASCAL V5.5-48 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES } o For conformant varying parameters (both VAR and value semantics), a pointer to a Pascal-specific descriptor is passed. The descriptor (subject to change) looks like: struct { long pointer-to-varying-data long maximum-length } 1.10 Problems Corrected Since Last Release Of DEC Pascal o The compiler would sometimes generate incorrect object file information when inheriting environment files written by a very old compiler. This problem has been fixed. o The compiler did not issue a "Duplicate global name" message when a global PROGRAM name or a global MODULE name had already been used as a global defining point. This problem has been fixed o The compiler did not generate checking code for assignments of CHARs to conformarnt varying parameters. Unlike VARYINGs, conformant varyings can have a max-length of 0. This problem has been fixed. o For conformant array of conformant varying parameters, the compiler did not compute the max-length of the varyings correctly. This problem has been fixed. o If NEW builtin was used with a non-pointer type a segmentation fault would occasionally occur. This problem has been fixed. o If a conformant array of conformant varyings was passed to another procedure as a conformant array of conformant varyings, the size of the varying component was not computed correctly. This problem has been fixed. DEC PASCAL V5.5-48 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES o The compiler will sometimes assume that a variable passed to a VAR schematic parameter would not be modified by the called routine when in fact it was modified. This problem has been fixed. o The compiler generated invalid environment files for modules that defined enumerated types and also used those enumerated types in an I/O statement inside the defining module. This problem has been fixed. You will have to recompile the defining module and all modules that are dependent on that PEN file (or any subsequent PEN file). There has been no change in the format of the PEN file for this correction. o If non-string parameters were used with the EQ, NE, LT, LE, GE, GT builtin functions an Internal Compiler Error would occur. An error message is not generated. o Some of the checking code generated in routine prologs used the wrong line number. This problem has been corrected. o The code generated for some FOR loops with unsigned control variables would cause integer overflow exceptions when the value changed from 16_ 7FFFFFFF to 16_ 8000000. This problem has been corrected. o If both sides of an assignment statement contained sub-string accesses, the compiler generated incorrect code. This problem has been fixed. o If a SET type with an explicit size attribute was used as the type of a value parameter, incorrect code was generated. This problem has been fixed. o Constructors for unpacked arrays of small (less than 32 bits) packed records generated incorrect code. This problem has been fixed. o Casting integer and real values to QUADRUPLE produced an Internal Compiler Error. This problem has been fixed. o When compiling with checking disabled the SUBSTR builtin would occasionally cause an Internal Compiler Error. This problem has been fixed. DEC PASCAL V5.5-48 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES o Floating constants that are smaller than MINREAL were not properly converted to 0.0, but rather generated a syntax error. This problem has been fixed. o An Internal Compiler Error occured when checking was enabled and an assignment was made to a schematic SET constained within a de-referenced undiscriminated schema pointer. This problem has been fixed. o An Internal Compiler Error occured processing some deeply nested structured types containing many schematic types. This problem has been fixed. o Boolean key values in FINDK statements were handled incorrectly. They are now controlled by the /ENUMERATION_SIZE qualifier. o When compiling with checking disabled, incorrect code was generated for some types of parameters when the only references to them were via the UPPER and LOWER builtin functions. This problem has been fixed.