VAX SDL Version V3.2-12 Release Notes 1 INTRODUCTION This set of release notes describes the features (new and changed), restrictions (new and removed), and bug fixes for VAX SDL Version V3.2-12. VAX SDL Version V3.2-12 corrects three documentation problems that were present in Version V3.2-11. These corrections are described in the next section. Descriptions of bug fixes and other changes in VAX SDL Versions V3.2-12, V3.2-11, V3.2-10, T3.2-9, T3.2-8, T3.2-7, T3.2-6, T3.2-5, X3.2-4, X3.2-3, and X3.2-2 follow in the next eleven sections. These changes are in addition to those made at the time of the release of VAX SDL Version X3.2-1, which form the main body of these release notes. To print a copy of the VAX SDL Version V3.2-12 release notes, type the following: $ PRINT SYS$HELP:SDL032.RELEASE_NOTES 2 Changes in VAX SDL V3.2-12 o The Guide to the VAX Structure Definition Language now includes a table of contents, which was omitted in Version V3.2-11. o The kit installation procedure now specifies the correct location of the SDL notes file (TURRIS::SDL). o The kit installation procedure now specifies the correct name for the SYSTARTUP_V5.COM procedure. 3 Changes in VAX SDL V3.2-11 o The Guide to the VAX Structure Definition Language has been updated for Version 3.2. o The SDL help text has been updated for Version 3.2. In addition, several miscellaneous problems in the help text have been fixed. o VAX LSE templates for the SDL language have been improved and updated for Version 3.2. Page 2 4 Changes in VAX SDL V3.2-10 o VAX SDL no longer incurs an access violation when translating into Ada a reference to a pre-defined aggregate preceded by an IFLANGUAGE statement. o The BASIC$data-type record definitions generated in BASIC language output have been conditionalized in order to prevent re-definition of these record structures within a BASIC program. o In BASIC language output, the single component of the record generated for an ITEM with the TYPEDEF attribute now contains the name "ITEM" instead of "FILL (1)" to facilitate direct access to the data item within the record structure. o DIMENSION * now yields name[] instead of name[1] in C language output. o In VAX MACRO language output, VAX SDL no longer generates an extra (duplicate) .MACRO directive for a module when the first statement in the module is a DECLARE statement. o In Pascal language output, the [UNSAFE] attribute is now generated for LIST parameters that are conformant strings. 5 Changes in VAX SDL T3.2-9 o The appropriate attributes (including passing mechanism and dimension) are now generated in PL/I language output for parameters that are of a pre-defined aggregate type. 6 Changes in VAX SDL T3.2-8 o The appropriate attributes (including storage class and dimension) are now generated in PL/I language output for items that are of a user-defined type. o The header that is optionally included at the beginning of an output file now indicates that the file was created by "VAX" SDL instead of "VAX-11" SDL. Page 3 7 Changes in VAX SDL T3.2-7 o The PL/I DECLARE statement generated for an ITEM defined with the TYPEDEF attribute no longer appears inside a comment in PL/I language output. 8 Changes in VAX SDL T3.2-6 o A parameter of a user-defined type with the VALUE attribute now yields the specified user-defined type name (instead of INTEGER) in VAX Pascal language output. o The DEFAULT clause may now be specified for a parameter of an AGGREGATE type (i.e., STRUCTURE or UNION). Please note that the expression specified in the DEFAULT clause is always passed to the called routine by the immediate value mechanism. 9 Changes in VAX SDL T3.2-5 o Macro names generated for ENTRY definitions without an ALIAS clause specified now conform to VMS macro naming conventions. These macro naming changes apply only to BLISS and MACRO language output. o SDL no longer generates duplicate boundary variable names within certain conformant array type parameter descriptions in VAX Pascal. o SDL now correctly generates the %REF foreign mechanism specifier in appropriate VAX Pascal parameter descriptions. o SDL now prevents long string constants from causing a FORTRAN source record to extend beyond column 72 by splitting up the string using FORTRAN continuation records and string concatenation. o SDL no longer generates CHARACTER*1 in FORTRAN language output for aggregate members of type CHARACTER LENGTH 0. Instead, an informational comment is generated for the aggregate member. o Spurious blank lines are no longer written to PL/I output files when processing explicitly DECLAREd items or items which are included in a compilation via the READ statement. Page 4 o All behavior by the PL/I back end previously under the control of the /VMS_DEVELOPMENT qualifier has now been placed instead under the control of a new qualifier, /PLI_DEVELOPMENT. 10 Changes in VAX SDL X3.2-4 All changes in VAX SDL X3.2-4 are related to Ada language output. These Ada output changes are: o SDL now generates correct Ada language output when translating a UNION definition that references a pre-defined AGGREGATE. (Previously, either an access violation would be incurred or incorrect Ada language output would be generated.) o The DESCRIPTOR and RTL_STR_DESC parameter passing mechanism attributes are now translated to DESCRIPTOR(S) and DESCRIPTOR(SB), respectively, for ENTRY arguments of type CHARACTER. o A correct default value of FALSE is now generated for a BOOLEAN DEFAULT 0 argument with the TYPENAME BOOLEAN clause attached. o A correct default value is now generated for a record component that is of a user type (TYPEDEF) that is, in turn, defined to be of another user type. o A correct default value of FALSE is now generated for a record component that is of a user type defined to be BOOLEAN. o A correct type name and default value are now always generated for an item that is of an AGGREGATE user type. 11 Changes in VAX SDL X3.2-3 Bug fixes and other changes in VAX SDL Version X3.2-3 were: o For C language output, the generated code for an internal reference to the pre-tag of the containing structure or union has been corrected. The type reference is now correctly prefixed with struct or union. o For Ada language output, an inconsistency in appending _TYPE to item names has been corrected. o The detection of forward reference errors in VAX Pascal, introduced in X3.2-2, has been corrected. o The detection of forward reference errors in VAX Ada has been added. Page 5 o The text of the error message ILLFORWREF has been changed to accommodate VAX Ada as well as VAX Pascal. o SDL's internal symbol tables are now correctly initialized at the start of each module for multi-module compilations. Prior to this, it was possible for definitions from an earlier module to be incorrectly re-used. 12 Changes in VAX SDL X3.2-2 Bug fixes and other changes in VAX SDL Version X3.2-2 are: o An access violation in the PASCAL and EPASCAL back ends with very large sources no longer occurs. o DECLARED forward references for user-defined types can now be defined later in the same module (with TYPEDEF). o The PASCAL back end now coalesces contiguous TYPE and VAR sections under a single occurrence of the keyword. o The PASCAL back end now reports an error for an illegal forward reference to a non-base type. o A check is now made to ensure that redefined user-defined types have the same type as well as the same size. This is implemented as part of the new PASCAL error checks. o The C back end now generates correct code for a structure or union element that refers to a structure or union with the TYPEDEF attribute. 13 NEW FEATURES 13.1 User-defined Data Types A user-defined data type is specified by including the new keyword TYPEDEF in an ITEM or AGGREGATE declaration. The keyword may appear where GLOBAL, COMMON or BASED are permitted, and the four keywords are mutually exclusive. The effect is to generate a type declaration in the output language, where this is supported. Some languages already do this for an ITEM or AGGREGATE declaration, in which case the TYPEDEF is ignored. The primary purpose of this addition is to extend type declaration to the C language back end. The modified SDL syntax is as follows (`sizeopt' is explained in section 13.3): Page 6 ITEM item-name { data-type } [ COMMON ] { user-type sizeopt } [ GLOBAL ] [ TYPEDEF ] [ DIMENSION [ lbound: ] hbound ] [ PREFIX prefix-string ] [ TAG tag-string ] ; Page 7 AGGREGATE aggregate-name { STRUCTURE } [ data-type ] { UNION } [ COMMON ] [ GLOBAL ] [ BASED pointer-name ] [ TYPEDEF ] [ DIMENSION [ lbound: ] hbound ] [ PREFIX prefix-string ] [ TAG tag-string ] [ ORIGIN member-name ] [ FILL ] ; aggregate-body . . END [ aggregate-name ]; An example of the type declaration of an aggregate is: AGGREGATE MyStruct STRUCTURE TYPEDEF PREFIX jg$ ; i1 LONGWORD ; i2 LONGWORD ; END ; This may then be referenced in a succeeding ITEM declaration as follows: ITEM foo MyStruct ; 13.1.1 Caveat With the inclusion of user-defined data types, the undocumented feature whereby built-in SDL data types could be abbreviated is no longer available. For example, the name CHAR will now be treated as a reference to a user-defined data type and not expanded to mean CHARACTER. 13.2 Entry point return types The RETURNS clause may now reference a user-defined data type in addition to the built-in SDL data types. Also a new keyword VOID is added as a return type. VOID is required for the C language back end, which causes a return type of `int' to be generated if the RETURNS clause is omitted. Page 8 The revised syntax for the ENTRY statement is as follows (`sizeopt' is explained in section 13.3): ENTRY entry-name [ ALIAS internal-name ] [ PARAMETER (param-desc,...) ] [ LINKAGE link-name ] [ VARIABLE ] [ RETURNS return-data-type [NAMED param-name ] ] [ TYPENAME type-name ] ; return-data-type = { data-type } { user-type sizeopt } { VOID } 13.3 Undeclared type references The purpose of this new feature is to allow the declaration of a data item of a user-defined type that is unknown in the current SDL compilation, but will be known when the target language source is compiled, through the inclusion of a file which defines the type. SDL needs to know the size of this undefined type to account for overall size when included in an AGGREGATE declaration. SDL also needs to know its equivalent predefined type so that the correct default tag letter, if required, can be output. This is achieved by extending the SDL syntax by the addition of a DECLARE statement. This explicitly declares the unknown variable to be of the size and type of a known data type. An unknown variable may also be implicitly declared in the body of a module by appending the SIZEOF clause. It is permissible for a variable to be declared more than once (either explicitly or implicitly), but any subsequent declaration must match the first; otherwise an error is given. The parameter to the SIZEOF clause may be a built-in SDL data type, a user-defined type that is defined in the current SDL compilation, or an expression. If an expression is given it must evaluate to the number of bytes to be reserved for this object. If the object is dimensioned, the SIZEOF expression must evaluate to the size of a single element. The default tag letter for the object (of unknown type) being sized is derived from the type in the SIZEOF clause. If an expression is used in place of a data type to reserve a fixed number of bytes, the default tag letter is T (character string). As always, the default tag may be overridden by an explicit TAG option. Although DECLARE statements and implicit SIZEOF declarations appear in the output tree for use by the back ends, these do not result in specific Page 9 generated code. A new statement with the following syntax is added: DECLARE user-type SIZEOF { data-type } [ PREFIX prefix-string ] { user-type } { ( expression ) } [ TAG tag-string ] The parentheses around the `expression' option are necessary to distinguish syntactically between user-type and a name or string used as a constant. The section of the above syntax SIZEOF { data-type } { user-type } { ( expression ) } is the SIZEOF clause, and may be appended to a user type in several constructs as shown in sections 13.1 and 13.2 in order to make an implicit declaration of the item. The term `sizeopt' means that a SIZEOF clause may optionally appear. 13.3.1 Restrictions Data types that are aggregate names may not be qualified by SIZEOF; nor may SIZEOF clauses be nested where the syntax would otherwise allow it. In either case, an error results. For example, DECLARE foo SIZEOF ADDRESS (bar SIZEOF LONGWORD); is illegal, whereas DECLARE foo SIZEOF ADDRESS (CHARACTER); and ITEM foo ADDRESS (bar SIZEOF LONGWORD); are both valid. 13.4 Local include A new statement, READ "file-spec";, has been added. The file specification refers to a previously-generated SDL intermediate (.SDI) file. The file is read, and the definitions of numeric constants, aggregate names, and user-defined type names are made available to the current compilation. The actual definitions are not included in the output target language file(s). Page 10 This means that cross-referencing of constants, etc., in other sources can be made. Because the definitions do not appear in the output file, they may need to be included when the output language file is compiled. References to constants are the exception: the numeric value of a constant is substituted at SDL compile time, and no reference to the constant name is made in the output file. 13.5 String constants The CONSTANT syntax has been extended to include string constants. A new keyword STRING has been introduced. The new syntax is: CONSTANT constant-name constant-class constant-class = { EQUALS expression numeric-options } { EQUALS STRING string string-options } numeric-options = [ PREFIX prefix-string ] [ TAG tag-string ] [ COUNTER #local-name ] [ TYPENAME type-name ] ; string-options = [ PREFIX prefix-string ] [ TAG tag-string ] ; The syntax CONSTANT ( ... ) EQUALS expression remains unchanged, and is not valid for string constants. Each output language has its own mechanism for delimiting strings and for handling delimiters and other special characters embedded in the string. In the SDL source, a string is delimited with quotation marks ("string"), and an embedded quotation mark is represented as a pair of quotation marks. For example, the SDL statement CONSTANT str EQUALS STRING "String 'with' some ""embedded"" quotes"; is output in PL/I as %replace str by 'String ''with'' some "embedded" quotes'; in C as #define str "String 'with' some \"embedded\" quotes" Page 11 and in BASIC as DECLARE STRING CONSTANT str = "String 'with' some " + '"embedded" quotes' 13.5.1 Caveat The word STRING may well already appear in current sources as a data name. As this usage clashes with the new reserved word, these sources must be changed to enclose the word "string" in quotation marks. 13.6 Conditional compilation A new statement IFLANGUAGE has been added. This can be used to control whether the translation of a particular section of SDL source code will be included in the output for a particular language or set of languages. LITERAL statements (see next section) may also be included in a conditional section. This is useful for cases where a particular construct for a particular language is needed. The syntax is as follows: IFLANGUAGE lang1 lang2 lang3 /* Start comment . . . set of SDL statements . . . END_IFLANGUAGE [lang1 lang2 lang3] ; /* End comment 'lang1 lang2 ...' is a list of languages supported by SDL, separated by spaces. The language name must be spelled in full, and is not checked for validity. Each language back end checks whether its language name is in the list, and if so, outputs the conditional code. The reason for not checking validity is that SDL should not have a list of language back ends built into it. This allows additional language back ends to be incorporated in future. The brackets around the language list on the END_IFLANGUAGE keyword mean that the list is optional. However if the list is supplied, it must match the language(s) supplied with the IFLANGUAGE keyword, but not necessarily in the same order. If the list does not match, a warning message is given (see NEW MESSAGES). If the same language name appears more than once in the list after IFLANGUAGE, a DUPCONATT (duplicate or conflicting attributes) error is given. Comments are treated as follows: 1. A comment after IFLANGUAGE is only output if the conditional code is being output for a particular language. This is because the comment is considered to be within the body of the conditional. Page 12 2. A comment after END_IFLANGUAGE is always output, as it is outside the body of the conditional. 13.7 Text pass-through (LITERAL statement) This new feature allows source text to be passed through to the output language file without translation. This may be used in conjunction with conditional compilation to output constructs in a particular language that cannot be represented in SDL. However it should be used with care because the purpose of SDL is to enable constructs to be represented in multiple languages. The feature uses new keywords LITERAL and END_LITERAL, and the syntax is as follows: LITERAL; literal text line 1 literal text line 2 . . . END_LITERAL; /* End comment Note that a comment may not appear after the LITERAL keyword, as this is considered to be within the body of the literal. If further text appears on the same line after the LITERAL; a syntax error will result. 13.8 Prefix and tag suppression This version supplies a new command-line qualifier, /SUPPRESS, which takes two optional keyword values, PREFIXES and TAGS. This may appear as /SUPPRESS=PREFIXES, /SUPPRESS=TAGS, or as /SUPPRESS=(PREFIXES,TAGS). /SUPPRESS without a value has no effect. The effect of the qualifier is to suppress the addition of prefixes and/or tags to names that would otherwise be added when an SDL source is compiled. Note that because SDL does not add a default tag to a name unless a prefix is supplied, suppression of prefixes alone will also suppress default tags. Prefix and tag suppression can only be effected when the original source is compiled. If an intermediate file is generated by use of the /PARSE qualifier, without suppression of prefixes/tags, it is not possible to suppress them later when using the /NOPARSE qualifier. The qualifiers /NOPARSE and /SUPPRESS are mutually exclusive and will result in a DCL error if both appear on a command line. The reason for this is that by the time the intermediate file is generated, any prefixes and tags have already been attached to the name, and it is not possible later to detach them. Page 13 14 NEW MESSAGES 14.1 Warning Message LANGMATCH, Language list does not match IFLANGUAGE [Line n] Explanation: The optional list of languages after END_IFLANGUAGE does not match the list after IFLANGUAGE. User action: Correct the second list, or remove it. 14.2 Error Messages SIZEREDEF, Size or type of item redefined [Line n] Explanation: An undeclared type has alread been declared in an earlier DECLARE statement or SIZEOF clause, and an attempt is being made to redefine the object with a different size or type. User action: Remove the offending SIZEOF clause, or change it to match the earlier declaration. SIZEQUAL, Item , an aggregate, cannot be qualified by SIZEOF [Line n] Explanation: The subject of a SIZEOF clause is a previously declared aggregate. User action: Remove the SIZEOF clause, or correct the name. SIZENEST, Illegal nesting of SIZEOF clauses (Item ) [Line n] Explanation: An attempt has been made to nest SIZEOF clauses. User action: Remove the additional SIZEOF clause(s), or remove the nested element into a separate DECLARE statement. STRINGCONST, String constant used in arithmetic expression [Line n] Explanation: The constant name used in an arithmetic expression has been defined as a string constant. User action: Correct the reference. ILLFORWREF, Illegal forward reference for output language [Line n] Page 14 Explanation: A forward reference to a non-base type has been generated in VAX Pascal output, or any forward reference has been generated in VAX Ada output. User action: Correct the SDL source, or do not use with these output languages. 15 NEW KEYWORDS The following is a list of 10 new reserved words in the VAX SDL language. If you currently use any of these keywords as names in your VAX SDL source files, you may retain the word's name usage by placing double quotation marks (" ") around the word. DECLARE END_IFLANGUAGE END_LITERAL IFLANGUAGE LITERAL READ SIZEOF STRING TYPEDEF VOID