Compaq Pascal V5.8-89 for Tru64 UNIX Release Notes 23 August 2000 This document contains information about Compaq Pascal V5.8-89 including new features, and other topics. This file is of interest to both system management and application programmers. CONTENTS CHAPTER 1 COMPAQ PASCAL V5.8-89 FOR TRU64 UNIX RELEASE NOTES 1.1 Overview Of Compaq Pascal . . . . . . . . . . . . 1-1 1.2 New Features In Compaq Pascal . . . . . . . . . . 1-1 1.2.1 Compaq Pascal Web Page . . . . . . . . . . . . . 1-2 1.2.2 New -version Option For Displaying Compiler Version . . . . . . . . . . . . . . . . . . . . 1-2 1.2.3 IADDRESS64 Predeclard Routine . . . . . . . . . 1-2 1.2.4 TRUNC64, ROUND64, UTRUNC64, And UROUND64 Predeclard Routines . . . . . . . . . . . . . . 1-2 1.2.5 Enhanced Optimization And Code Generation . . . 1-3 1.3 Compaq Pascal Run-Time Library . . . . . . . . . . 1-3 1.3.1 Compaq Pascal Run-Time Library And DECthreads . 1-3 1.3.2 Compaq Pascal Run-Time Library And The QUADRUPLE Datatype . . . . . . . . . . . . . . . . . . . . 1-3 1.4 Known Problems And Restrictions . . . . . . . . . 1-3 1.5 Documentation Errors . . . . . . . . . . . . . . . 1-7 1.5.1 Errors In The Compaq Pascal Reference Manual . . 1-7 1.5.2 Errors In The Compaq Pascal Installatio Guide For Tru64 UNIX . . . . . . . . . . . . . . . . 1-8 1.5.3 Errors In The Compaq Pascal User Manual For Tru64 UNIX . . . . . . . . . . . . . . . . . . . 1-8 1.6 Compiling For Optimal Performance . . . . . . . . 1-9 1.7 Compaq Pascal Run-Time Library Support Routines 1-10 1.8 Exception Handling On Tru64 UNIX . . . . . . . . 1-10 1.9 Migrating Compaq Pascal Programs . . . . . . . . 1-11 1.9.1 Migrating From RISC ULTRIX Systems To Tru64 UNIX Systems . . . . . . . . . . . . . . . . . 1-11 1.9.2 Migrating From OpenVMS Systems To Tru64 UNIX . 1-13 1.9.2.1 Sharing Environment Files Across Platforms . 1-13 1.9.2.2 Default Size For Enumerated Types And Booleans . . . . . . . . . . . . . . . . . . 1-14 1.9.2.3 Default Data Layout For Unpacked Arrays And Records . . . . . . . . . . . . . . . . . . 1-14 1.9.2.4 IADDRESS And VOLATILE . . . . . . . . . . . 1-14 1.9.2.5 INT On Large Unsigned Numbers Now Overflows 1-15 1.9.2.6 Bound Procedure Values . . . . . . . . . . . 1-15 1.9.2.7 Argument List Functions . . . . . . . . . . 1-15 1.9.2.8 %DICTIONARY Directive . . . . . . . . . . . 1-15 1.9.2.9 VAX Floating Datatypes . . . . . . . . . . . 1-16 1.9.2.10 Relative And Indexed Files . . . . . . . . . 1-16 1.9.3 Calling C Routines From Pascal . . . . . . . . 1-16 1.10 Problems Corrected Since Last Release Of Compaq Pascal . . . . . . . . . . . . . . . . . . . . . 1-17 CHAPTER 1 COMPAQ PASCAL V5.8-89 FOR TRU64 UNIX RELEASE NOTES 1.1 Overview Of Compaq Pascal Compaq Pascal V5 is a major release of the Compaq Pascal language. The major new features of Compaq Pascal V5 are: 1. New platform support. Compaq Pascal now supports OpenVMS Alpha and Tru64 UNIX (formerly known as 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 Compaq Pascal. Compaq Pascal V5.8-89 requires Digital UNIX V4.0B or later. 1.2 New Features In Compaq Pascal Since the release of V5.7, Compaq Pascal for Tru64 UNIX systems contain: 1. New -version option to easily display the compiler version from the command line 2. Bug fixes 3. Enhanced optimization and code generation 4. Support for INTEGER64 and UNSIGNED64 with the UPPER and LOWER predeclared routines 5. New predeclared routines (TRUNC64, ROUND64, UTRUNC64, UROUND64) to convert floating expressions into INTEGER64 or COMPAQ PASCAL V5.8-89 FOR TRU64 UNIX RELEASE NOTES UNSIGNED64 values. These routines are defined identically to the existing corresponding routines (TRUNC, ROUND, UTRUNC, UROUND) but return 64-bit values instead of 32-bit values 1.2.1 Compaq Pascal Web Page You can find the Compaq Pascal home page at http://www.openvms.compaq.com/commercial/pascal/pascal_index.html Please visit the web site and register with us via the "Pascal Feedback" button. By registering with us, we can send out updates on future Compaq Pascal releases as well as getting your feedback on Compaq Pascal features and future directions. 1.2.2 New -version Option For Displaying Compiler Version A new -version option has been added to display the compiler's version string from the command line. The display also includes all five fields from the uname() output as well. When the -version option is present, the compiler will print out the version information and exit back to the operating system. No other options or source files will be processed. The syntax is -version 1.2.3 IADDRESS64 Predeclard Routine An IADDRESS64 predeclared routine has been added to return a 64-bit address value. This routine is most useful on OpenVMS Alpha systems where the IADDRESS function returns only a 32-bit value. On Tru64 UNIX systems, IADDRESS already returns a 64-bit value and is identical to IADDRESS64. 1.2.4 TRUNC64, ROUND64, UTRUNC64, And UROUND64 Predeclard Routines Four new predeclared routines, TRUNC64, ROUND64, UTRUNC64, and UROUND64, have been added to convert floating expressions into INTEGER64 and UNSIGNED64 values. These new routines are defined identically to the existing corresponding routines, TRUNC, ROUND, COMPAQ PASCAL V5.8-89 FOR TRU64 UNIX RELEASE NOTES UTRUNC, and UROUND, but return 64-bit values intead of 32-bit values. 1.2.5 Enhanced Optimization And Code Generation Compaq Pascal contains a newer version of the GEM code generator that includes better optimizations and code generation. 1.3 Compaq Pascal Run-Time Library 1.3.1 Compaq Pascal Run-Time Library And DECthreads The Compaq Pascal Run-Time Library has been enhanced to work properly with DECthreads. To install the RTL on another system, just install the DPOxxx kit on the systems and chose the RTL subset. The thread-safe support has been merged into the RTL bundled on the base CDROM in Digital UNIX V4.0. The thread support was introduced in DPORTL541. 1.3.2 Compaq 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 make sure that the RTL on those system contains the QUADRUPLE support. To do this, just install the DPOxxx kit on the systems and chose the RTL subset. The QUADRUPLE support has been merged into the RTL bundled on the base CDROM in Digital UNIX V4.0. The QUADRUPLE support was introduced in DPORTL540. 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 Compaq Pascal for Tru64 UNIX. 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 COMPAQ PASCAL V5.8-89 FOR TRU64 UNIX RELEASE NOTES CASE D OF 1: (F1:INTEGER); 2: (F2:CHAR); END; Compaq 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; Compaq 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 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]; Compaq 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); COMPAQ PASCAL V5.8-89 FOR TRU64 UNIX RELEASE NOTES BEGIN V.TWO := 2; { Is illegal since it changes variants from 1 to 2 } END; Compaq 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 Compaq 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 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. COMPAQ PASCAL V5.8-89 FOR TRU64 UNIX RELEASE NOTES 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. 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: 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) The predeclared constants MAXINT64 and MAXUNSIGNED64 are not present. However, you can use LOWER(INTEGER64), LOWER(UNSIGNED64), UPPER(INTEGER64), and UPPER(UNSIGNED64) in an executable section to obtain the same values. f) INTEGER64/UNSIGNED64 types cannot be used in variable typecasts. 13. The compiler does not automatically close local files when the declaring routine returns. This will be fixed in a future release. 14. The compiler does not support debug information for the following data/variable types: a) Schematic variables (except the predefined type STRING) b) Conformant varying parameters c) Conformant parameters COMPAQ PASCAL V5.8-89 FOR TRU64 UNIX RELEASE NOTES We will try to provide better debug information for these data types in a future release of Compaq Pascal if possible. 1.5 Documentation Errors 1.5.1 Errors In The Compaq Pascal Reference Manual 1. The descriptions of the TO BEGIN DO clause in Section 3.3 and the TO END DO clause in Section 3.4 should note that you can control the name of the compiler-generated routine that encapsulates the two clauses by using the GLOBAL attribute. 2. In Section 4.4, Type Conversions, the 5th paragraph omitted the "**" operators in the printed edition from the sentence: "When combined with other unsigned values, negative integer values are converted to large unsigned values by the calculation of the modulus with respect to 2**32 or 2**64." 3. The text for the "NOT IN" operator in Section 4.2.5 should be colored as an extension. 4. The text for the UINT function in Section 8.94 should indicate that the value returned is "x MOD 2**32". In the printed version of the manual, the "**" operator was omitted. 5. The text for the UINT64 function in Section 8.95 lists the usage as "UINT(x)" instead of "UINT64(x)". Also, the section should indicate that the value returned is "x MOD 2**64". In the printed version of the manual, the "**" operator was omitted. 6. The description of the GLOBAL attribute in Section 10.2.17 should indicate that using the GLOBAL attribute on a MODULE changes the name of the MODULE's compiler-generatation initialization routine. Normally, the initialization routine, if needed, is named 'module-name'%INIT. However, the usage of the percent sign makes it difficult to use in a shareable image environment on OpenVMS. Using the GLOBAL attribute allows for the name to be changed so it can be inserted in the shareable image's symbol vector. 7. The following paragraph has been added to Section 11.4 for the %IF directive Note that skipped sections must still be valid Compaq Pascal tokens. The skipped tokens are not processed semantically by the compiler except for control expressions of nested %IF directives. All control expressions are COMPAQ PASCAL V5.8-89 FOR TRU64 UNIX RELEASE NOTES semantically processed to ensure they result in a Boolean result. %INCLUDE and %DICTIONARY directives encountered while skipping tokens do not attempt to open the filename or access the dictionary path. Instead, they return the token 'TRUE'. 8. The text for %ARCH_NAME in Section 11.7 should indicate that the directive returns the string "VAX" or "Alpha". 9. The text for %SYSTEM_NAME in Section 11.7 should indicate that the directive returns the string "OpenVMS" or "DigitalUNIX". 10. The INTEGER8, UNSIGNED8, UNSIGNED16, UNSIGNED32, and UNSIGNED64 types are missing from the index. They should point back to Section 2.1.1.1 or 2.1.1.2. 1.5.2 Errors In The Compaq Pascal Installatio Guide For Tru64 UNIX 1. Updating the whatis database The Compaq Pascal for Tru64 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 Compaq Pascal documentation subset (DPOMANnnn), invoke the catman(1) program from the root account with the -w flag. For example, # catman -w 1.5.3 Errors In The Compaq Pascal User Manual For Tru64 UNIX 1. Use of [ENVIRONMENT] attribute without a filename In the Compaq Pascal User Manual for Tru64 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, COMPAQ PASCAL V5.8-89 FOR TRU64 UNIX RELEASE NOTES { 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')] 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.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 -O4 -arch host -assume noaccuracy You may also want to use the performance flagger ( -usage performance) COMPAQ PASCAL V5.8-89 FOR TRU64 UNIX RELEASE NOTES to identify datatypes that could be modified for additional performance. Note that the is another level of optimization (-O5) above the default level of 4. However, from our experience, -O5 provides little benefit to most Pascal program and may actually result in slower code than level 4. Please note that -math_library fast and -assume noaccuracy may cause programs that depend on exact mathematical results to produce incorrect answers. The remaining switches should not impact the results of programs. 1.7 Compaq 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 be opened before the routine can be called. 1.8 Exception Handling On Tru64 UNIX To support the ESTABLISH and REVERT builtins, non-local GOTOs, and to signal and print run-time error messages, the Compaq 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 COMPAQ PASCAL V5.8-89 FOR TRU64 UNIX RELEASE NOTES 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 Compaq Pascal Programs 1.9.1 Migrating From RISC ULTRIX Systems To Tru64 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 Compaq Pascal documentation for more information. 1. Pascal for RISC and Compaq 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 Compaq Pascal for Tru64 UNIX Systems. a) The Pascal for RISC independent compilation feature is not supported in Compaq Pascal. Compaq Pascal provides independent compilation via environment files, see the Compaq Pascal Language Reference Manual for more information. b) The Pascal for RISC NULL statement is not supported in Compaq Pascal. c) The Pascal for RISC syntax for modifying the default alignment rules for record fields is not supported in Compaq Pascal. Compaq Pascal provides the POS and ALIGNED attributes to implement this feature. See the Compaq 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 option "-apc". The default integer size cannot be changed in Compaq Pascal. e) The Pascal for RISC type conversion routines ALFA, BOOLEAN, CHAR, CARDINAL, DOUBLE, INTEGER, INTEGER16, INTEGER32, and REAL are not provided by Compaq Pascal. f) The maximum length of identifiers in Pascal for RISC is 32 characters, in Compaq Pascal identifiers can be up to 31 characters in length. COMPAQ PASCAL V5.8-89 FOR TRU64 UNIX RELEASE NOTES g) Pascal for RISC allows certain negative numbers in SETs. Compaq Pascal only allows positive numbers in SETs. h) Pascal for RISC allows up to 512 items in an INTEGER or CARDINAL SET. Compaq 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. Compaq Pascal writes them in upper case. j) Pascal for RISC has different default field widths than Compaq Pascal. k) Pascal for RISC defines the type CHAR as being the subrange 0..127 when used as a base-type. Compaq Pascal allows the full subrange 0..255 when CHAR is used as a base-type. l) Pascal for RISC and Compaq 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 Compaq Pascal definition for type-casting. See the Compaq Pascal Language Reference Manual for more information in type-casting in Compaq Pascal. n) The Pascal for RISC command options -w, -stdiso, -stdansi, are provided by the Compaq Pascal options -nowarn, -std ansi, and -std iso. o) The Pascal for RISC command option -casesense is not supported. Mixed case names are provided by Compaq 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 Compaq Pascal. 2. There are behavioral and implementation differences between Pascal for RISC and Compaq Pascal. The following list enumerates the differences you might see at run-time when running code compiled by Compaq Pascal for Tru64 UNIX Systems. a) Pascal for RISC always short-circuits the AND and OR boolean operators. Compaq Pascal only guarantees short-circuiting for the AND_THEN and OR_ELSE boolean operators. COMPAQ PASCAL V5.8-89 FOR TRU64 UNIX RELEASE NOTES b) Pascal for RISC determines REAL vs. DOUBLE precision constants based on their use. Compaq Pascal provides a mechanism for specifying constants that are DOUBLE precision, see the Compaq Pascal Language Reference Manual for more details. By default, all floating constants are of type REAL in Compaq Pascal. c) Pascal for RISC uses a "non-zero" value for the ordinal value of TRUE. Compaq Pascal will only store a 1 into boolean variables for a TRUE value. Non-Pascal code passing boolean arguments to Compaq Pascal could notice behavior differences if even numbers (2,4,6...) were placed into boolean variables to signify TRUE, Compaq Pascal will treat even values as FALSE since the low order bit is not set. d) Pascal for RISC supports the STLIMIT procedure. Compaq 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. Compaq Pascal follows the Pascal standard, which dictates that strings printed with a field width of 0 print no characters. f) Pascal for RISC left justifies output when negative field widths are used. Compaq Pascal treats negative field widths as runtime errors. 1.9.2 Migrating From OpenVMS Systems To Tru64 UNIX The following sections describe issues which affect Compaq Pascal programs being moved from OpenVMS systems to Tru64 UNIX. 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 Compaq Pascal for Tru64 UNIX compiler. COMPAQ PASCAL V5.8-89 FOR TRU64 UNIX RELEASE NOTES 1.9.2.2 Default Size For Enumerated Types And Booleans The default size for enumerations and Booleans in unpacked structures is longword on Tru64 UNIX. 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 Tru64 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 Tru64 UNIX, you can use the -align vax command qualifier or the [ALIGN(VAX)] attribute. 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 Compaq 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 Tru64 UNIX, the Compaq 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. COMPAQ PASCAL V5.8-89 FOR TRU64 UNIX RELEASE NOTES 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 Compaq 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. Compaq 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, Compaq Pascal will pass the address of the entry point. On Tru64 UNIX, 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 Compaq 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 Tru64 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 Tru64 UNIX. 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 Tru64 UNIX. COMPAQ PASCAL V5.8-89 FOR TRU64 UNIX RELEASE NOTES 1.9.2.9 VAX Floating Datatypes None of the VAX floating datatypes are supported on Tru64 UNIX (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. 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 "Compaq Pascal User Manual for Tru64 UNIX" 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. Compaq 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: COMPAQ PASCAL V5.8-89 FOR TRU64 UNIX RELEASE NOTES 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 } 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 Compaq Pascal o Improve the error message when using substring access on PACKED ARRAY OF CHAR arrays that are larger than 65535 characters long. These long arrays are not considered strings by Compaq Pascal. o The run-time detection of circularites in TO BEGIN DO sections did not produce a 'useful' message. This problem has been corrrected. Generating a circularity between multiple TO BEGIN DO sections requires 'tricking' the compiler and is not possible COMPAQ PASCAL V5.8-89 FOR TRU64 UNIX RELEASE NOTES under normal Pascal programming practices. o The compiler would sometimes produce incorrect code for string concatenations. This incorrect code would use the wrong register to access the partially concatenated string and would yield an incorrect result. This problem has been corrected. o The compiler would generate a static variable without a name when a schema type was discriminated at 'module-level'. This caused an error message from the linker. This problem has been corrected. o When typecasting a variable to a smaller type, the compiler would incorrectly use the size of the variable instead of using the size of the smaller type. This affects SIZE(BigVar::SmallerType) which will now return the size of the SmallerType, not the size of the BigVar. It also affects assigning into BigVar::SmallerType by just updating the leading part of the BigVar without touching the bytes at the end. Previously, the extra bytes would be zero-filled. It also affects passing BigVar::SmallerType to value conformant array parameters. Previously, the resulting conformant parameter's size and bounds would reflect the size of the BigVar, not of the SmallerType. It now reflects the size of the SmallerType. o The compiler might not issue the ASYREQVOL warning message when INPUT or OUTPUT is used as a default file variable inside of an asynchronous routine. This problem has been fixed. o In the executable section, the UPPER and LOWER builtins did not return the correct values for the INTEGER64 or UNSIGNED64 types. This has been corrected. Note that using INTEGER64 or UNSIGNED64 types or literals in compile-time expressions is still not supported. New builtins (TRUNC64, ROUND64, UTRUNC64, and UROUND64) have been added to convert floating expressions into 64-bit integer or 64-bit unsigned values. COMPAQ PASCAL V5.8-89 FOR TRU64 UNIX RELEASE NOTES o The compiler did not flag the user of UPPER and LOWER with 64-bit types in compile time expressions. Also using INT64 and UINT64 in compile time expressions produced misleading error messages. Both of these problems have been fixed. o Add the /VERSION qualifier on OpenVMS and the -version option on Tru64 UNIX to print the compiler and OS version information to standard output. o The compiler or run-time system reported missing constructor components for a variable of schema array type, when, in fact, there were too many. This problem has been fixed. o When the /SHOW=STRUCTURE_LAYOUT option was used (-show structure_layout on Tru64 UNIX), the listing failed to display very large, though valid, sizes and offsets. This problem has been fixed. o Improve formatting of schema types in /SHOW=STRUCTURE_LAYOUT (-show structure_layout on Tru64 UNIX). o The compiler would print incorrectly position messages for symbols containing non-standard characters when /STANDARD was used. The symbols must be ones already defined by the compiler such as OR_ELSE, AND_ATOMIC, RECORD_LENGTH, etc. This problem has been fixed. The compiler will still print these standards messages when these symbols are being used with the builtin meaning. In theory, these messages should be supressed and only messages when redefining these symbols should be generated. This may be addressed in a future version of the compiler. o The compiler did not produce a non-standard message when command line constants were declared and used. The compiler now will product a non-standard diagnostic when a command line constant is used in a program. o The compiler did not detect the use of IADDRESS on a record field that was not on a byte-boundary when a pointer-dereference was used to designate the record field. For example: IADDRESS(P.UNALIGNED_FIELD). Later in the compilation, an internal compiler error would occur when a subsequent phase of the compiler detected that it was requested to generate the address of something that COMPAQ PASCAL V5.8-89 FOR TRU64 UNIX RELEASE NOTES was not on a byte-boundary. This problem has been fixed.