DEC Pascal V5.6-60 for Digital UNIX Systems Release Notes 29 August 1997 This document contains information about DEC Pascal V5.6-60 including new features, and other topics. This file is of interest to both system management and application programmers. CONTENTS CHAPTER 1 DEC PASCAL V5.6-60 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 Passing Readonly Components To VAR Parameters . 1-2 1.2.2 -assume accuracy_sensitive Command Line Option . 1-2 1.2.3 Enhanced Optimization And Code Generation . . . 1-3 1.3 DEC Pascal Run-Time Library . . . . . . . . . . . 1-3 1.3.1 Run-Time Library Now Thread-safe . . . . . . . . 1-3 1.3.2 DEC 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 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.5.4 Optimize Attribute Corrections . . . . . . . . . 1-8 1.6 Compiling For Optimal Performance . . . . . . . 1-10 1.7 DEC Pascal Run-Time Library Support Routines . . 1-11 1.8 Exception Handling On Digital UNIX . . . . . . . 1-11 1.9 Migrating DEC Pascal Programs . . . . . . . . . 1-11 1.9.1 Migrating From RISC ULTRIX Systems To Digital UNIX Systems . . . . . . . . . . . . . . . . . 1-11 1.9.2 Migrating From OpenVMS Systems To Digital UNIX Systems . . . . . . . . . . . . . . . . . . . 1-14 1.9.2.1 Sharing Environment Files Across Platforms . 1-14 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-15 1.9.2.5 INT On Large Unsigned Numbers Now Overflows 1-15 1.9.2.6 Bound Procedure Values . . . . . . . . . . . 1-16 1.9.2.7 Argument List Functions . . . . . . . . . . 1-16 1.9.2.8 %DICTIONARY Directive . . . . . . . . . . . 1-16 1.9.2.9 VAX Floating Datatypes . . . . . . . . . . . 1-16 1.9.2.10 Relative And Indexed Files . . . . . . . . . 1-17 1.9.3 Calling C Routines From Pascal . . . . . . . . 1-17 1.10 Problems Corrected Since Last Release Of DEC Pascal . . . . . . . . . . . . . . . . . . . . . 1-18 CHAPTER 1 DEC PASCAL V5.6-60 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.6-60 requires Digital UNIX V3.2C or later. 1.2 New Features In DEC Pascal This release of DEC Pascal contains: 1. Bug fixes 2. Enhanced optimization and code generation 3. Command line option for assuming floating point accuracy of program DEC PASCAL V5.6-60 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES 1.2.1 Passing Readonly Components To VAR Parameters Previous versions of DEC Pascal would permit passing components of readonly variables to VAR parameters. The compiler would detect passing an entire readonly variable to a VAR parameter, but it accidently missed the case of passing just a component of a variable. For example, program bug; procedure proc(var i : integer); begin i := i + 1; end; var r : [readonly] record f1 : integer; f2 : integer; end; begin a(r.f1); end. These cases are now detected by DEC Pascal and an appropriate error message is generated. 1.2.2 -assume accuracy_sensitive Command Line Option The -assume accuracy_sensitive command line option specifies whether certain code transformations that affect floating-point operations are allowed. These changes may or may affect the accuracy of the program's results. If you specify noaccuracy_sensitive, the compiler is free to reorder floating-point operations based on algebraic identities (inverses, associativity, and distribution). This allows the compiler to move additional floating-point operations outside of loops or reduce or remove floating-point operations totally, thereby improving performance. The default, accuracy_sensitive, directs the compiler to avoid certain floating-point trasformations that might slighly affect the program's accuracy. In previous versions of DEC Pascal on Digital UNIX systems, the compiler defaulted to noaccuracy_sensitive, which resulted in some programs getting unexpected results. These transformations are now disabled by default and you must explicitly request them. DEC PASCAL V5.6-60 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES 1.2.3 Enhanced Optimization And Code Generation DEC Pascal contains a newer version of the GEM code generator that includes better optimizations and code generation. 1.3 DEC Pascal Run-Time Library 1.3.1 Run-Time Library Now Thread-safe The DEC 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 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 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 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 V5.6-60 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES 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 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 DEC PASCAL V5.6-60 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES 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 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. DEC PASCAL V5.6-60 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES 12. The UNDEFINED predeclared routine is not yet supported with IEEE floating point types. 13. 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) 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. 14. The compiler does not automatically close local files when the declaring routine returns. This will be fixed in a future release. 15. The compiler does not produce correct debug information for the following data/variable types: a) Schematic variables (except the predefined type STRING) b) Conformant varying parameters c) Conformant parameters DEC PASCAL V5.6-60 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES We will attempt to provide better debug information for these data types in a future release of DEC Pascal. 1.5 Documentation Errors 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, DEC PASCAL V5.6-60 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES 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.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.5.4 Optimize Attribute Corrections Due to a problem in the compiler, optimization occurred when the /NOOPT qualifier was used and a form of the OPTIMIZE([NO]INLINE) attribute was used. This problem has been corrected. The use of the OPTIMIZE([NO]INLINE) attribute only controls whether inlining is enabled, not whether other code optimizations are enabled. The DEC Pascal Language Reference Manual section describing the OPTIMIZE attribute has been expanded to more fully describe the interaction between the OPTIMIZE attribute and the /OPTIMIZE qualifier. Here is that updated text: DEC PASCAL V5.6-60 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES OPTIMIZE -------- The OPTIMIZE attribute specifies optimization options that are to be enabled during compilation of a compilation unit or routine. OPTIMIZE [[( {identifier},... )]] The options listed with the OPTIMIZE attribute are enabled. The negation of an option disables that optimization. The valid options are ALL, NONE, INLINE, NOINLINE. Attribute Action ---------------------------- ----------------------------------- [OPTIMIZE], [OPTIMIZE(ALL)] Enables all optimization components. Inline expansion of user-defined routines is enabled in automatic selection mode. [OPTIMIZE(NOINLINE)] Disables inline expansion for user defined routines. All other optimization components are enabled/disabled according to command line or the setting of the OPTIMIZE attribute on an enclosing scope routine. [OPTIMIZE(INLINE)] Enables preferential inline expansion of user-defined routines. All other optimization components are enabled/disabled according to command line or the setting of the OPTIMIZE attribute on an enclosing scope routine. [OPTIMIZE(ALL,NOINLINE]) Enables all optimization components, disables inline expansion for user defined routines. [OPTIMIZE(NONE,INLINE)] Disables all optimization components, enables inline expansion of user-defined routines. [NOOPTIMIZE],[OPTIMIZE(NONE)] Disables all optimization components, disables inline exapsnion of user-defined routines. Usage and Default Information ----------------------------- o This attribute can be applied to routines and compilation units. o Optimization features specified with the OPTIMIZE attribute override command line settings and settings inherited from outer scopes. DEC PASCAL V5.6-60 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES o The INLINE option specifies that a routine should be inlined preferentially, regardless of the results of heuristics which are normally used to automatically determine if a routine is to be inlined. There are still cases where a routine that is marked as INLINE preferred will not be inline expanded, such as routines that have formal parameters of non-static types, or that declare or access non-static types. o If no OPTIMIZE attribute is specified for a routine in a nested scope, the OPTIMIZE attribute settings from the enclosing routine are used. o If the OPTIMIZE attribute is used on a routine on OpenVMS Alpha or Digital UNIX systems, only the INLINE and NOINLINE keywords are processed. The other forms of the OPTIMIZE attribute are parsed but perform no function. You cannot modify the optimization settings of individual routines on these systems. Usage and Default Information on OpenVMS systems only: ------------------------------------------------------ o On OpenVMS VAX systems, if an explicit OPTIMIZE(INLINE) attribute exists on a routine declaration, the compiler checks for anything that prohibits inline expansion of the routine, such as it being an external routine. However, the compiler does not check the call environment, such as the size of the calling and called routine. Instead, if it is legal to expand the routine, it always expands the code, regardless of the call environment. This gives you more control over the decision to inline a routine. o On OpenVMS VAX systems, DEC Pascal does not inline routines that have formal parameters of nonstatic types, or that declare or access objects of nonstatic types. 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 -arch host You may also want to use the new performance flagger ( -usage performance) to identify datatypes that could be modified for additional performance. DEC PASCAL V5.6-60 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES 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 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 DEC PASCAL V5.6-60 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES 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 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 DEC PASCAL V5.6-60 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES 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 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. DEC PASCAL V5.6-60 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES 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. 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 DEC PASCAL V5.6-60 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES 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. 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. DEC PASCAL V5.6-60 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES 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. 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. DEC PASCAL V5.6-60 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES 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 "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 DEC PASCAL V5.6-60 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES } 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 DEC Pascal o With checking disabled, subscripting the result of a SUBSTR function produced incorrect results. This problem has been fixed. o An Internal Compiler Error occasionally occurred if the only reference to a up-level variable within a procedure was with the BYTE_OFFSET function. This problem has been fixed. o If a single variable was referenced via two different names, such as with two VAR conformant array parameters or one VAR conformant parameter and one up-level variable, the compiler occasionally generated incorrect code. This problem has been fixed. o Incorrect code was generated when the SIZE builtin was used with an operand containing a sub-string-access, for example SIZE(pac[i..j]). This problem has been fixed. DEC PASCAL V5.6-60 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES o The TRUNC predeclared routine generated incorrect code when used with a QUADRUPLE type. This problem has been corrected. o When compiling with /ALIGN=Alpha_AXP or -ALIGN Alpha_AXP (the default on Alpha systems) passing a schematic array of VARYINGs to a conformant parameter did not always work. This problem has been fixed. o The compiler would sometimes generate errors when compiling source that is on a remote NFS or DFS disk. This problem has been fixed. o An Internal Compiler Error occured when the ADD_INTERLOCKED builtin function was used in a logical expression. This problem has been fixed. o When initializing large ARRAYs with partial initial-state, huge amounts of memory were used by the compiler. The algorithm has been changed to improve performance. o The NEXT and BITNEXT builtin functions returned the wrong result for some schema types. This problem has been fixed. o ARRAY constructors containing OTHERWISE ZERO did not work correctly when used in declarations. This problem has been fixed. o A component of a [READONLY] variable could be passed to a VAR parameter without generating any wanning message. This problem has been fixed; a warning message is generated. o Added new switch -assume [no]accuracy_sensitive to control floating-point transformations done by the compiler. o The compiler did not generate correct error messages for array declarations larger than MAXINT bits. This problem has been fixed. o The [OPTIMIZE(INLINE)] attribute was ignored on routines. This has been corrected. The [OPTIMIZE(INLINE)] and [OPTIMIZE(NOINLINE)] attributes on routines are now correctly processed. DEC PASCAL V5.6-60 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES o The compiler generated incorrect code to initialize file variables inside records containing discriminated schema types. This problem has been fixed. o Record fields of discriminated schema types were not properly aligned within records. This problem has been fixed. o The compiler generated incorrect code for [LIST] parameters of type VARYING OF CHAR. The code would copy extra bytes and could generate an ACCVIO/segementation-fault if the incoming parameter was near a page boundary. The extra bytes copied did not overwrite other storage so the code would not cause incorrect results. It would either work or get an run-time error. This problem has been corrected. o When using double precision floating values in constant expressions, the compiler would generate alignment faults. This problem has been corrected. o The compiler would sometimes incorrectly clear out the upper part of PACKED ARRAY OF BOOLEAN arrays that were 64-bits in size. This problem has been corrected. o When the address of a volatile variable was used through a pointer, the compiler would not realize that the assignment through the pointer would also change the volatile variable. This problem has been fixed. o When using %DESCR on a variable with a size attribute, the V5.5 compiler incorrectly field in the dtype and size fields based on the variable's base type and ignored the size attribute. The problem has been fixed and the previous behavior has been restored. o The compiler did not issue an error when using a record field as a FOR loop index when FOR loop was inside a WITH statement that used a dereferenced pointer. For example, WITH ptr_to_record^ DO FOR record_field := 1 TO 10 DO ; The compiler already detected the similar error of WITH record_variable DO FOR record_field := 1 TO 10 DO ; DEC PASCAL V5.6-60 FOR DIGITAL UNIX SYSTEMS RELEASE NOTES This problem has been fixed. The compiler now issues the error message for first example as well as the second example. o The compiler did not detect the illegal use of a default parameter value when the parameter's type is run-time sized. This problem has been fixed. o An Internal Compiler Error would sometimes occur when the ZERO builtin was used as an initial state specifier for a large record type and the /STANDARD qualifier was specified. This problem has been fixed. o The compiler would generate an incorrect initial state for INTEGER64 variables at the outer level of a program if the initial value was negative. This problem has been fixed.