home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / adav313.zip / gnat-3_13p-docs.zip / gnat_rm.INF (.txt) < prev    next >
OS/2 Help File  |  2001-09-16  |  227KB  |  8,120 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. -Preface- ΓòÉΓòÉΓòÉ
  3.  
  4.  
  5. ΓòÉΓòÉΓòÉ 2. GNAT Reference Manual ΓòÉΓòÉΓòÉ
  6.  
  7.  GNAT Reference Manual 
  8.  
  9.  GNAT, The GNU Ada 95 Compiler 
  10.  
  11.  Version 3.13p Date: 2000/05/16 04:55:48 
  12.  
  13.  Ada Core Technologies, Inc. 
  14.  
  15.  (C) Copyright 1995-2000, Ada Core Technologies - All Rights Reserved 
  16.  
  17.  This document may be copied, in whole or in part, in any form or by any means, 
  18.  as is or with alterations, provided that (1) alterations are clearly marked as 
  19.  alterations and (2) this copyright notice is included unmodified in any copy. 
  20.  
  21.  Silicon Graphics and IRIS are registered trademarks and IRIX is a trademark of 
  22.  Silicon Graphics, Inc. 
  23.  
  24.  IBM PC is a trademark of International Business Machines Corporation. 
  25.  
  26.  UNIX is a registered trademark of AT&T Bell Laboratories. DIGITAL 
  27.  
  28.  VADS is a registered trademark of Rational Software Inc. 
  29.  
  30.  The following are trademarks of Digital Equipment Corporation: DEC, DEC Ada, 
  31.  DECthreads, Digital, OpenVMS, and VAX. 
  32.  
  33.  About This Guide              About This Guide 
  34.  Implementation Defined PragmasImplementation Defined Pragmas 
  35.  Implementation Defined AttributesImplementation Defined Attributes 
  36.  Implementation Advice         Implementation Advice 
  37.  Implementation Defined CharacteristicsImplementation Defined Characteristics 
  38.  Representation Clauses and PragmasRepresentation Clauses and Pragmas 
  39.  Standard Library Routines     Standard Library Routines 
  40.  The Implementation of Standard I/OThe Implementation of Standard I/O 
  41.  The GNAT Library              The GNAT Library 
  42.  Interfacing to Other LanguagesInterfacing to Other Languages 
  43.  Machine Code Insertions       Machine Code Insertions 
  44.  GNAT Implementation of TaskingGNAT Implementation of Tasking 
  45.  Code generation for array aggregatesCode generation for array aggregates 
  46.  Specialized Needs Annexes     Specialized Needs Annexes 
  47.  Compatibility Guide           Compatibility Guide 
  48.  Index                         --- The Detailed Node Listing --- About This 
  49.                                Guide 
  50.  What This Reference Manual ContainsWhat This Reference Manual Contains 
  51.  Related Information           Related Information The Implementation of 
  52.                                Standard I/O 
  53.  Standard I/O Packages         Standard I/O Packages 
  54.  FORM Strings                  FORM Strings 
  55.  Direct_IO                     Direct_IO 
  56.  Sequential_IO                 Sequential_IO 
  57.  Text_IO                       Text_IO 
  58.  Wide_Text_IO                  Wide_Text_IO 
  59.  Stream_IO                     Stream_IO 
  60.  Shared Files                  Shared Files 
  61.  Open Modes                    Open Modes 
  62.  Operations on C Streams       Operations on C Streams 
  63.  Interfacing to C Streams      Interfacing to C Streams The GNAT Library 
  64.  GNAT.Bubble_Sort_A (g-busora.ads)GNAT.Bubble_Sort_A (g-busora.ads) 
  65.  GNAT.Bubble_Sort_G (g-busorg.ads)GNAT.Bubble_Sort_G (g-busorg.ads) 
  66.  GNAT.Calendar (g-calend.ads)  GNAT.Calendar (g-calend.ads) 
  67.  GNAT.Case_Util (g-casuti)     GNAT.Case_Util (g-casuti) 
  68.  GNAT.Calendar.Time_IO (g-catiio.ads)GNAT.Calendar.Time_IO (g-catiio.ads) 
  69.  GNAT.Command_Line (g-comlin.ads)GNAT.Command_Line (g-comlin.ads) 
  70.  GNAT.Current_Exception (g-curexc.ads)GNAT.Current_Exception (g-curexc.ads) 
  71.  GNAT.Debug_Pools (g-debpoo.ads)GNAT.Debug_Pools (g-debpoo.ads) 
  72.  GNAT.Debug_Utilities (g-debuti.ads)GNAT.Debug_Utilities (g-debuti.ads) 
  73.  GNAT.Directory_Operations (g-dirope.ads)GNAT.Directory_Operations 
  74.                                (g-dirope.ads) 
  75.  GNAT.Float_Control (g-flocon.ads)GNAT.Float_Control (g-flocon.ads) 
  76.  GNAT.Heap_Sort_A (g-hesora.ads)GNAT.Heap_Sort_A (g-hesora.ads) 
  77.  GNAT.Heap_Sort_G (g-hesorg.ads)GNAT.Heap_Sort_G (g-hesorg.ads) 
  78.  GNAT.HTable (g-htable.ads)    GNAT.HTable (g-htable.ads) 
  79.  GNAT.IO (g-io.ads)            GNAT.IO (g-io.ads) 
  80.  GNAT.IO_Aux (g-io_aux.ads)    GNAT.IO_Aux (g-io_aux.ads) 
  81.  GNAT.Lock_Files (g-locfil.ads)GNAT.Lock_Files (g-locfil.ads) 
  82.  GNAT.OS_Lib (g-os_lib.ads)    GNAT.OS_Lib (g-os_lib.ads) 
  83.  GNAT.Regexp (g-regexp.ads)    GNAT.Regexp (g-regexp.ads) 
  84.  GNAT.Regpat (g-regpat.ads)    GNAT.Regpat (g-regpat.ads) 
  85.  GNAT.Spell_Checker (g-speche.ads)GNAT.Spell_Checker (g-speche.ads) 
  86.  GNAT.Spitbol.Patterns (g-spipat.ads)GNAT.Spitbol.Patterns (g-spipat.ads) 
  87.  GNAT.Spitbol (g-spitbo.ads)   GNAT.Spitbol (g-spitbo.ads) 
  88.  GNAT.SPITBOL.Table_Boolean (g-sptabo.ads)GNAT.SPITBOL.Table_Boolean 
  89.                                (g-sptabo.ads) 
  90.  GNAT.SPITBOL.Table_Integer (g-sptain.ads)GNAT.SPITBOL.Table_Integer 
  91.                                (g-sptain.ads) 
  92.  GNAT.SPITBOL.Table_VString (g-sptavs.ads)GNAT.SPITBOL.Table_VString 
  93.                                (g-sptavs.ads) 
  94.  GNAT.Table (g-table.ads)      GNAT.Table (g-table.ads) 
  95.  GNAT.Task_Lock (g-tasloc.ads) GNAT.Task_Lock (g-tasloc.ads) 
  96.  GNAT.Threads (g-thread.ads)   GNAT.Threads (g-thread.ads) 
  97.  GNAT.Traceback (g-traceb.ads) GNAT.Traceback (g-traceb.ads) 
  98.  GNAT.Traceback.Symbolic (g-trasym.ads)GNAT.Traceback.Symbolic (g-trasym.ads) 
  99.                                Text_IO 
  100.  Text_IO Stream Pointer PositioningText_IO Stream Pointer Positioning 
  101.  Text_IO Reading and Writing Non-Regular FilesText_IO Reading and Writing 
  102.                                Non-Regular Files 
  103.  Get_Immediate                 Get_Immediate 
  104.  Treating Text_IO Files as StreamsTreating Text_IO Files as Streams 
  105.  Text_IO Extensions            Text_IO Extensions 
  106.  Text_IO Facilities for Unbounded StringsText_IO Facilities for Unbounded 
  107.                                Strings Wide_Text_IO 
  108.  Wide_Text_IO Stream Pointer PositioningWide_Text_IO Stream Pointer Positioning 
  109.  Wide_Text_IO Reading and Writing Non-Regular FilesWide_Text_IO Reading and 
  110.                                Writing Non-Regular Files Interfacing to Other 
  111.                                Languages 
  112.  Interfacing to C              Interfacing to C 
  113.  Interfacing to C++            Interfacing to C++ 
  114.  Interfacing to COBOL          Interfacing to COBOL 
  115.  Interfacing to Fortran        Interfacing to Fortran 
  116.  Interfacing to non-GNAT Ada codeInterfacing to non-GNAT Ada code GNAT 
  117.                                Implementation of Tasking 
  118.  Mapping Ada Tasks onto the Underlying Kernel ThreadsMapping Ada Tasks onto the 
  119.                                Underlying Kernel Threads 
  120.  Ensuring Compliance with the Real-Time AnnexEnsuring Compliance with the 
  121.                                Real-Time Annex 
  122.  
  123.  
  124. ΓòÉΓòÉΓòÉ 3. About This Guide ΓòÉΓòÉΓòÉ
  125.  
  126.  
  127.  This manual contains useful information in writing programs using the GNAT 
  128.  compiler. It includes information on implementation dependent characteristics 
  129.  of GNAT, including all the information required by Annex M of the standard. 
  130.  
  131.  Ada 95 is designed to be highly portable,and guarantees that, for most 
  132.  programs, Ada 95 compilers behave in exactly the same manner on different 
  133.  machines. However, since Ada 95 is designed to be used in a wide variety of 
  134.  applications, it also contains a number of system dependent features to be 
  135.  used in interfacing to the external world. 
  136.  
  137.  Note: Any program that makes use of implementation-dependent features may be 
  138.  non-portable.  You should follow good programming practice and isolate and 
  139.  clearly document any sections of your program that make use of these features 
  140.  in a non-portable manner. 
  141.  
  142.  What This Reference Manual ContainsWhat This Reference Manual Contains 
  143.  Conventions                   Conventions 
  144.  Related Information           Related Information 
  145.  
  146.  
  147. ΓòÉΓòÉΓòÉ 3.1. What This Reference Manual Contains ΓòÉΓòÉΓòÉ
  148.  
  149.  This reference manual contains the following chapters: 
  150.  
  151.      Implementation Defined Pragmas lists GNAT implementation-dependent 
  152.       pragmas, which can be used to extend and enhance the functionality of the 
  153.       compiler. 
  154.  
  155.      Implementation Defined Attributes lists GNAT implementation-dependent 
  156.       attributes which can be used to extend and enhance the functionality of 
  157.       the compiler. 
  158.  
  159.      Implementation Advice provides information on generally desirable 
  160.       behavior which are not requirements that all compilers must follow since 
  161.       it cannot be provided on all systems, or which may be undesirable on some 
  162.       systems. 
  163.  
  164.      Implementation Defined Characteristics provides a guide to minimizing 
  165.       implementation dependent features. 
  166.  
  167.      Representation Clauses and Pragmas describes in detail the way that GNAT 
  168.       represents data, and in particular the exact set of representation 
  169.       clauses and pragmas that is accepted. 
  170.  
  171.      Standard Library Routines provides a listing of packages and a brief 
  172.       description of the functionality that is provided by Ada's extensive set 
  173.       of standard library routines as implemented by GNAT. 
  174.  
  175.      The Implementation of Standard I/O details how the GNAT implementation of 
  176.       the input-output facilities. 
  177.  
  178.      Interfacing to Other Languages describes how programs written in Ada 
  179.       using GNAT can be interfaced to other programming languages. 
  180.  
  181.      Specialized Needs Annexes describes the GNAT implementation of all of the 
  182.       special needs annexes. 
  183.  
  184.      Compatibility Guide includes sections on compatibility of GNAT with other 
  185.       Ada 83 and Ada 95 compilation systems, to assist in porting code from 
  186.       other environments. 
  187.  
  188.  This reference manual assumes that you are familiar with Ada 95 language, as 
  189.  described in the International Standard ANSI/ISO/IEC-8652:1995, Jan 1995. 
  190.  
  191.  
  192. ΓòÉΓòÉΓòÉ 3.2. Conventions ΓòÉΓòÉΓòÉ
  193.  
  194.  
  195.  Following are examples of the typographical and graphic conventions used in 
  196.  this guide: 
  197.  
  198.      Functions, utility program names, standard names, and classes. 
  199.  
  200.      'Option flags' 
  201.  
  202.      'File Names', 'button names', and 'field names'. 
  203.  
  204.      Variables. 
  205.  
  206.      Emphasis. 
  207.  
  208.      [optional information or parameters] 
  209.  
  210.      Examples are described by text 
  211.  
  212.                       and then shown this way.
  213.  
  214.  
  215.  Commands that are entered by the user are preceded in this manual by the 
  216.  characters "$ " (dollar sign followed by space). If your system uses this 
  217.  sequence as a prompt, then the commands will appear exactly as you see them in 
  218.  the manual. If your system uses some other prompt, then the command will 
  219.  appear with the $ replaced by whatever prompt character you are using. 
  220.  
  221.  
  222. ΓòÉΓòÉΓòÉ 3.3. Related Information ΓòÉΓòÉΓòÉ
  223.  
  224.  See the following documents for further information on GNAT 
  225.  
  226.      GNAT User's Guide, which provides information on how to use the GNAT 
  227.       compiler system. 
  228.  
  229.      Ada 95 Reference Manual, which contains all reference material for the 
  230.       Ada 95 programming language. 
  231.  
  232.      Ada 95 Annotated Reference Manual, which is an annotated version of the 
  233.       standard reference manual cited above. The annotations describe detailed 
  234.       aspects of the design decision, and in particular contain useful sections 
  235.       on Ada 83 compatibility. 
  236.  
  237.      DEC Ada, Technical Overview and Comparison on DIGITAL Platforms, which 
  238.       contains specific information on compatibility between GNAT and DEC Ada 
  239.       83 systems. 
  240.  
  241.      DEC Ada, Language Reference Manual, part number AA-PYZAB-TK which 
  242.       describes in detail the pragmas and attributes provided by the DEC Ada 83 
  243.       compiler system. 
  244.  
  245.  
  246. ΓòÉΓòÉΓòÉ 4. Implementation Defined Pragmas ΓòÉΓòÉΓòÉ
  247.  
  248.  
  249.  Ada 95 defines a set of pragmas that can be used to supply additional 
  250.  information to the compiler. These language defined pragmas are implemented in 
  251.  GNAT and work as described in the Ada 95 Reference Manual. 
  252.  
  253.  In addition, Ada 95 allows implementations to define additional pragmas whose 
  254.  meaning is defined by the implementation. GNAT provides a number of these 
  255.  implementation-dependent pragmas which can be used to extend and enhance the 
  256.  functionality of the compiler. This section of the GNAT Reference Manual 
  257.  describes these additional pragmas. 
  258.  
  259.  Note that any program using these pragmas may not be portable to other 
  260.  compilers (although GNAT implements this set of pragmas on all platforms). 
  261.  Therefore if portability to other compilers is an important consideration, the 
  262.  use of these pragmas should be minimized. 
  263.  
  264.  pragma Abort_Defer 
  265.  
  266.            Syntax: 
  267.  
  268.                       pragma Abort_Defer;
  269.  
  270.  This pragma must appear at the start of the statement sequence of a handled 
  271.  sequence of statements (right after the begin). It has the effect of deferring 
  272.  aborts for the sequence of statements (but not for the declarations or 
  273.  handlers, if any, associated with this statement sequence). 
  274.  
  275.  pragma Ada_83 
  276.  
  277.            Syntax: 
  278.  
  279.                       pragma Ada_83;
  280.  
  281.  A configuration pragma that establishes Ada 83 mode for the unit to which it 
  282.  applies, regardless of the mode set by the command line switches. In Ada 83 
  283.  mode, GNAT attempts to be as compatible with the syntax and semantics of Ada 
  284.  83, as defined in the original Ada 83 Reference Manual as possible. In 
  285.  particular, the new Ada 95 keywords are not recognized, optional package 
  286.  bodies are allowed, and generics may name types with unknown discriminants 
  287.  without using the (<>) notation. In addition, some but not all of the 
  288.  additional restrictions of Ada 83 are enforced. 
  289.  
  290.  Ada 83 mode is intended for two purposes. Firstly, it allows existing legacy 
  291.  Ada 83 code to be compiled and adapted to GNAT with less effort. Secondly, it 
  292.  aids in keeping code backwards compatible with Ada 83. However, there is no 
  293.  guarantee that code that is processed correctly by GNAT in Ada 83 mode will in 
  294.  fact compile and execute with an Ada 83 compiler, since GNAT does not enforce 
  295.  all the additional checks required by Ada 83. 
  296.  
  297.  pragma Ada_95 
  298.  
  299.            Syntax: 
  300.  
  301.                       pragma Ada_95;
  302.  
  303.  A configuration pragma that establishes Ada 95 mode for the unit to which it 
  304.  applies, regardless of the mode set by the command line switches. This mode is 
  305.  set automatically for the Ada and System packages and their children, so you 
  306.  need not specify it in these contexts. This pragma is useful when writing a 
  307.  reusable component that itself uses Ada 95 features, but which is intended to 
  308.  be usable from either Ada 83 or Ada 95 programs. 
  309.  
  310.  pragma Annotate 
  311.  
  312.            Syntax: 
  313.  
  314.                       pragma Annotate (IDENTIFIER {, ARG});
  315.                       ARG ::= NAME | EXPRESSION
  316.  
  317.  This pragma is used to annotate programs. identifier identifies the type of 
  318.  annotation. GNAT verifies this is an identifier, but does not otherwise 
  319.  analyze it. The arg argument can be either a string literal or an expression. 
  320.  String literals are assumed to be of type Standard.String. Names of entities 
  321.  are simply analyzed as entity names. All other expressions are analyzed as 
  322.  expressions, and must be unambiguous. 
  323.  
  324.  The analyzed pragma is retained in the tree, but not otherwise processed by 
  325.  any part of the GNAT compiler. This pragma is intended for use by external 
  326.  tools, including ASIS. 
  327.  
  328.  pragma Assert 
  329.  
  330.            Syntax: 
  331.  
  332.                       pragma Assert (
  333.                        boolean_EXPRESSION
  334.                        [, static_string_EXPRESSION])
  335.  
  336.  The effect of this pragma depends on whether the corresponding command line 
  337.  switch is set to activate assertions. If assertions are inactive, the pragma 
  338.  has no effect. If assertions are enabled, then the semantics of the pragma is 
  339.  exactly equivalent to: 
  340.  
  341.                       if not boolean_EXPRESSION then
  342.                         System.Assertions.Raise_Assert_Failure
  343.                          (string_EXPRESSION);
  344.                       end if;
  345.  
  346.  The effect of the call is to raise System.Assertions.Assert_Failure. The 
  347.  string argument, if given, is the message associated with the exception 
  348.  occurrence. If no second argument is given, the default message is 'file:nnn', 
  349.  where file is the name of the source file containing the assert, and nnn is 
  350.  the line number of the assert. A pragma is not a statement, so if a statement 
  351.  sequence contains nothing but a pragma assert, then a null statement is 
  352.  required in addition, as in: 
  353.  
  354.  Note that, as with the if statement to which it is equivalent, the type of the 
  355.  expression is either Standard.Boolean, or any type derived from this standard 
  356.  type. 
  357.  
  358.                       ┬╖┬╖┬╖
  359.                       if J > 3 then
  360.                         pragma (Assert (K > 3, "Bad value for K"));
  361.                         null;
  362.                       end if;
  363.  
  364.  If the boolean expression has side effects, these side effects will turn on 
  365.  and off with the setting of the assertions mode, resulting in assertions that 
  366.  have an effect on the program. You should generally avoid side effects in the 
  367.  expression arguments of this pragma. However, the expressions are analyzed for 
  368.  semantic correctness whether or not assertions are enabled, so turning 
  369.  assertions on and off cannot affect the legality of a program. 
  370.  
  371.  pragma Ast_Entry 
  372.  
  373.            Syntax: 
  374.  
  375.                       pragma AST_Entry (entry_IDENTIFIER);
  376.  
  377.  This pragma is implemented only in the OpenVMS implementation of GNAT. The 
  378.  argument is the simple name of a single entry; at most one AST_Entry pragma is 
  379.  allowed for any given entry. This pragma must be used in conjunction with the 
  380.  AST_Entry attribute, and is only allowed after the entry declaration and in 
  381.  the same task type specification or single task as the entry to which it 
  382.  applies. This pragma specifies that the given entry may be used to handle an 
  383.  OpenVMS asynchronous system trap (AST) resulting from an OpenVMS system 
  384.  service call. The pragma does not affect normal use of the entry. For further 
  385.  details on this pragma, see the DEC Ada Language Reference Manual, section 
  386.  9.12a. 
  387.  
  388.  pragma C_Pass_By_Copy 
  389.  
  390.            Syntax: 
  391.  
  392.                       pragma C_Pass_By_Copy
  393.                        ([Max_Size =>] static_integer_EXPRESSION);
  394.  
  395.  Normally the default mechanism for passing C convention records to C 
  396.  convention subprograms is to pass them by reference, as suggested by RM 
  397.  B.3(69). Use the configuration pragma C_Pass_By_Copy to change this default, 
  398.  by requiring that record formal parameters be passed by copy if all of the 
  399.  following conditions are met: 
  400.  
  401.                1. The size of the record type does not exceed 
  402.                   static_integer_expression. 
  403.  
  404.                2. The record type has Convention C. 
  405.  
  406.                3. The formal parameter has this record type, and the subprogram 
  407.                   has a foreign (non-Ada) convention. 
  408.  
  409.  
  410.              If these conditions are met the argument is passed by copy, i.e. 
  411.              in a manner consistent with what C expects if the corresponding 
  412.              formal in the C prototype is a struct (rather than a pointer to a 
  413.              struct). 
  414.  
  415.              You can also pass records by copy by specifying the convention 
  416.              C_Pass_By_Copy for the record type, or by using the extended 
  417.              Import and Export pragmas, which allow specification of passing 
  418.              mechanisms on a parameter by parameter basis. 
  419.  
  420.  pragma Comment 
  421.  
  422.            Syntax: 
  423.  
  424.                                               pragma Comment (static_string_EXPRESSION);
  425.  
  426.              Synonymous for pragma Ident. 
  427.  
  428.  pragma Common_Object 
  429.  
  430.            Syntax: 
  431.  
  432.                                               pragma Common_Object (
  433.                                                  [Internal =>] LOCAL_NAME,
  434.                                                [, [External =>] EXTERNAL_SYMBOL]
  435.                                                [, [Size   =>] EXTERNAL_SYMBOL] )
  436.                                               EXTERNAL_SYMBOL ::=
  437.                                                IDENTIFIER
  438.                                               | static_string_EXPRESSION
  439.  
  440.              This pragma enables the shared use of variables stored in overlaid 
  441.              linker areas corresponding to the use of COMMON in Fortran.  The 
  442.              single object local_name is assigned to the area designated by the 
  443.              External argument. You may define a record to correspond to a 
  444.              series of fields. The size argument is syntax checked in GNAT, but 
  445.              otherwise ignored. 
  446.  
  447.              Common_Object is not supported on all platforms. If no support is 
  448.              available, then the code generator will issue a message indicating 
  449.              that the necessary attribute for implementation of this pragma is 
  450.              not available. 
  451.  
  452.  pragma Complex_Representation 
  453.  
  454.            Syntax: 
  455.  
  456.                                               pragma Complex_Representation
  457.                                                   ([Entity =>] LOCAL_NAME);
  458.  
  459.              The Entity argument must be the name of a record type which has 
  460.              two fields of the same floating-point type. The effect of this 
  461.              pragma is to force gcc to use the special internal complex 
  462.              representation form for this record, which may be more efficient. 
  463.              Note that this may result in the code for this type not conforming 
  464.              to standard ABI (application binary interface) requirements for 
  465.              the handling of record types. For example, in some environments, 
  466.              there is a requirement for passing records by pointer, and the use 
  467.              of this pragma may result in passing this type in floating-point 
  468.              registers. 
  469.  
  470.  pragma Component_Alignment 
  471.  
  472.            Syntax: 
  473.  
  474.                                               pragma Component_Alignment (
  475.                                                  [Form =>] ALIGNMENT_CHOICE
  476.                                                [, [Name =>] type_LOCAL_NAME]);
  477.                                               ALIGNMENT_CHOICE ::=
  478.                                                Component_Size
  479.                                               | Component_Size_4
  480.                                               | Storage_Unit
  481.                                               | Default
  482.  
  483.              Specifies the alignment of components in array or record types. 
  484.              The meaning of the Form argument is as follows: 
  485.  
  486.              Component_Size 
  487.                          Aligns scalar components and subcomponents of the 
  488.                          array or record type on boundaries appropriate to 
  489.                          their inherent size (naturally aligned). For example, 
  490.                          1-byte components are aligned on byte boundaries, 
  491.                          2-byte integer components are aligned on 2-byte 
  492.                          boundaries, 4-byte integer components are aligned on 
  493.                          4-byte boundaries and so on. These alignment rules 
  494.                          correspond to the normal rules for C compilers on all 
  495.                          machines except the VAX. 
  496.  
  497.              Component_Size_4 
  498.                          Naturally aligns components with a size of four or 
  499.                          fewer bytes. Components that are larger than 4 bytes 
  500.                          are placed on the next 4-byte boundary. 
  501.  
  502.              Storage_Unit 
  503.                          Specifies that array or record components are byte 
  504.                          aligned, i.e. aligned on boundaries determined by the 
  505.                          value of the constant System.Storage_Unit. 
  506.  
  507.              Default 
  508.                          Specifies that array or record components are aligned 
  509.                          on default boundaries, appropriate to the underlying 
  510.                          hardware or operating system or both. For OpenVMS VAX 
  511.                          systems, the Default choice is the same as the 
  512.                          Storage_Unit choice (byte alignment). For all other 
  513.                          systems, the Default choice is the same as 
  514.                          Component_Size (natural alignment). 
  515.  
  516.              If the Name parameter is present, type_local_name must refer to a 
  517.              local record or array type, and the specified alignment choice 
  518.              applies to the specified type. The use of Component_Alignment 
  519.              together with a pragma Pack causes the Component_Alignment pragma 
  520.              to be ignored. The use of Component_Alignment together with a 
  521.              record representation clause is only effective for fields not 
  522.              specified by the representation clause. 
  523.  
  524.              If the Name parameter is absent, the pragma can be used as either 
  525.              a configuration pragma, in which case it applies to one or more 
  526.              units in accordance with the normal rules for configuration 
  527.              pragmas, or it can be used within a declarative part, in which 
  528.              case it applies to types that are declared within this declarative 
  529.              part, or within any nested scope within this declarative part. In 
  530.              either case it specifies the alignment to be applied to any record 
  531.              or array type which has otherwise standard representation. 
  532.  
  533.              If the alignment for a record or array type is not specified 
  534.              (using pragma Pack, pragma Component_Alignment, or a record rep 
  535.              clause), the GNAT uses the default alignment as described 
  536.              previously. 
  537.  
  538.  pragma CPP_Class 
  539.  
  540.            Syntax: 
  541.  
  542.                                               pragma CPP_Class ([Entity =>] LOCAL_NAME);
  543.  
  544.              The argument denotes an entity in the current declarative region 
  545.              that is declared as a tagged or untagged record type. It indicates 
  546.              that the type corresponds to an externally declared C++ class 
  547.              type, and is to be laid out the same way that C++ would lay out 
  548.              the type. 
  549.  
  550.              If (and only if) the type is tagged, at least one component in the 
  551.              record must be of type Interfaces.CPP.Vtable_Ptr, corresponding to 
  552.              the C++ Vtable (or Vtables in the case of multiple inheritance) 
  553.              used for dispatching. 
  554.  
  555.              Types for which CPP_Class is specified do not have assignment or 
  556.              equality operators defined (such operations can be imported or 
  557.              declared as subprograms as required). Initialization is allowed 
  558.              only by constructor functions (see pragma CPP_Constructor). 
  559.  
  560.              Pragma CPP_Class is intended primarily for automatic generation 
  561.              using an automatic binding generator tool. Ada Core Technologies 
  562.              does not currently supply such a tool; See Interfacing to C++ for 
  563.              more details. 
  564.  
  565.  pragma CPP_Constructor 
  566.  
  567.            Syntax: 
  568.  
  569.                                               pragma CPP_Constructor ([Entity =>] LOCAL_NAME);
  570.  
  571.              This pragma identifies an imported function (imported in the usual 
  572.              way with pragma Import) as corresponding to a C++ constructor. The 
  573.              argument is a name that must have been previously mentioned in a 
  574.              pragma Import with Convention CPP, and must be of one of the 
  575.              following forms: 
  576.  
  577.                1. function Fname return T'Class 
  578.  
  579.                2. function Fname (┬╖┬╖┬╖) return T'Class 
  580.  
  581.  
  582.              where T is a tagged type to which the pragma CPP_Class applies. 
  583.  
  584.              The first form is the default constructor, used when an object of 
  585.              type T is created on the Ada side with no explicit constructor. 
  586.              Other constructors (including the copy constructor, which is 
  587.              simply a special case of the second form in which the one and only 
  588.              argument is of type T), can only appear in two contexts: 
  589.  
  590.                1. On the right side of an initialization of an object of type 
  591.                   T. 
  592.  
  593.                2. In an extension aggregate for an object of a type derived 
  594.                   from T. 
  595.  
  596.              Although the constructor is described as a function that returns a 
  597.              value on the Ada side, it is typically a procedure with an extra 
  598.              implicit argument (the object being initialized) at the 
  599.              implementation level. GNAT issues the appropriate call, whatever 
  600.              it is, to get the object properly initialized. 
  601.  
  602.              In the case of derived objects, you may use one of two possible 
  603.              forms for declaring and creating an object: 
  604.  
  605.                1. New_Object : Derived_T 
  606.  
  607.                2. New_Object : Derived_T := (constructor-function-call with 
  608.                   ┬╖┬╖┬╖) 
  609.  
  610.              In the first case the default constructor is called and extension 
  611.              fields if any are initialized according to the default 
  612.              initialization expressions in the Ada declaration. In the second 
  613.              case, the given constructor is called and the extension aggregate 
  614.              indicates the explicit values of the extension fields. 
  615.  
  616.              If no constructors are imported, it is impossible to create any 
  617.              objects on the Ada side. If no default constructor is imported, 
  618.              only the initialization forms using an explicit call to a 
  619.              constructor are permitted. 
  620.  
  621.              Pragma CPP_Constructor is intended primarily for automatic 
  622.              generation using an automatic binding generator tool. Ada Core 
  623.              Technologies does not currently supply such a tool; See 
  624.              Interfacing to C++ for more details. 
  625.  
  626.  pragma CPP_Destructor ([Entity =>] LOCAL_NAME); 
  627.            This pragma identifies an imported procedure (imported in the usual 
  628.            way with pragma Import) as corresponding to a C++ destructor. 
  629.            LOCAL_NAME must be previously mentioned in a pragma Import with 
  630.            Convention CPP, and be of the following form: 
  631.  
  632.                                               procedure Fname (obj : in out T'Class);
  633.  
  634.              where T is a tagged type to which pragma CPP_Class applies. This 
  635.              procedure will be called automatically on scope exit if any 
  636.              objects of T are created on the Ada side. 
  637.  
  638.              Pragma CPP_Destructor is intended primarily for automatic 
  639.              generation using an automatic binding generator tool. Ada Core 
  640.              Technologies does not currently supply such a tool; See 
  641.              Interfacing to C++ for more details. 
  642.  
  643.  pragma CPP_Virtual 
  644.  
  645.            Syntax: 
  646.  
  647.                                               pragma CPP_Virtual
  648.                                                  [Entity   =>] ENTITY,
  649.                                                [, [Vtable_Ptr =>] vtable_ENTITY,]
  650.                                                [, [Position  =>] static_integer_EXPRESSION])
  651.  
  652.              This pragma serves the same function as pragma Import in that case 
  653.              of a virtual function imported from C++. The Entity argument must 
  654.              be a primitive subprogram of a tagged type to which pragma 
  655.              CPP_Class applies. The Vtable_Ptr argument specifies the 
  656.              Vtable_Ptr component which contains the entry for this virtual 
  657.              function. The Position argument is the sequential number counting 
  658.              virtual functions for this Vtable starting at 1. 
  659.  
  660.              The Vtable_Ptr and Position arguments may be omitted if there is 
  661.              one Vtable_Ptr present (single inheritance case) and all virtual 
  662.              functions are imported.  In that case the compiler can deduce both 
  663.              these values. 
  664.  
  665.              No External_Name or Link_Name arguments are required for a virtual 
  666.              function, since it is always accessed indirectly via the 
  667.              appropriate Vtable entry. 
  668.  
  669.              Pragma CPP_Virtual is intended primarily for automatic generation 
  670.              using an automatic binding generator tool. Ada Core Technologies 
  671.              does not currently supply such a tool; See Interfacing to C++ for 
  672.              more details. 
  673.  
  674.  pragma CPP_Vtable 
  675.  
  676.            Syntax: 
  677.  
  678.                                               pragma CPP_Vtable (
  679.                                                [Entity    =>] ENTITY,
  680.                                                [Vtable_Ptr  =>] vtable_ENTITY,
  681.                                                [Entry_Count =>] static_integer_EXPRESSION);
  682.  
  683.              Given a record to which the pragma CPP_Class applies, this pragma 
  684.              can be specified for each component of type 
  685.              CPP.Interfaces.Vtable_Ptr. Entity is the tagged type, Vtable_Ptr 
  686.              is the record field of type Vtable_Ptr, and Entry_Count is the 
  687.              number of virtual functions on the C++ side. Not all of these 
  688.              functions need to be imported on the Ada side. 
  689.  
  690.              You may omit the CPP_Vtable pragma if there is only one Vtable_Ptr 
  691.              component in the record and all virtual functions are imported on 
  692.              the Ada side (the default value for the entry count in this case 
  693.              is simply the total number of virtual functions). 
  694.  
  695.              Pragma CPP_Vtable is intended primarily for automatic generation 
  696.              using an automatic binding generator tool. Ada Core Technologies 
  697.              does not currently supply such a tool; See Interfacing to C++ for 
  698.              more details. 
  699.  
  700.  pragma Debug 
  701.  
  702.            Syntax: 
  703.  
  704.                                               pragma Debug (PROCEDURE_CALL_STATEMENT);
  705.  
  706.              If assertions are not enabled on the command line, this pragma has 
  707.              no effect. If asserts are enabled, the semantics of the pragma is 
  708.              exactly equivalent to the procedure call. Pragmas are permitted in 
  709.              sequences of declarations, so you can use pragma Debug to 
  710.              intersperse calls to debug procedures in the middle of 
  711.              declarations. 
  712.  
  713.  pragma Eliminate 
  714.  
  715.            Syntax: 
  716.  
  717.                                               pragma Eliminate (
  718.                                                 [Unit_Name =>] IDENTIFIER |
  719.                                                         SELECTED_COMPONENT);
  720.                                               pragma Eliminate (
  721.                                                 [Unit_Name    =>]  IDENTIFIER |
  722.                                                            SELECTED_COMPONENT
  723.                                                 [Entity      =>]  IDENTIFIER |
  724.                                                            SELECTED_COMPONENT |
  725.                                                            STRING_LITERAL]
  726.                                                 [,[Parameter_Types =>] PARAMETER_TYPES]
  727.                                                 [,[Result_Type   =>] result_SUBTYPE_NAME]]);
  728.                                               PARAMETER_TYPES ::= (SUBTYPE_NAME {, SUBTYPE_NAME})
  729.                                               SUBTYPE_NAME   ::= STRING_LITERAL
  730.  
  731.              This pragma indicates that the given entity is unused in a 
  732.              program. The entity may be either a subprogram or a variable. 
  733.  
  734.              If the entity to be eliminated is a library level subprogram, then 
  735.              the first form of pragma Eliminate is used with only a single 
  736.              argument. In this form, the Unit_Name argument specifies the name 
  737.              of the library  level unit to be eliminated. 
  738.  
  739.              In all other cases, both Unit_Name and Entity arguments are 
  740.              required. item is an entity of a library package, then the first 
  741.              argument specifies the unit name, and the second argument 
  742.              specifies the particular entity. If the second argument is in 
  743.              string form, it must correspond to the internal manner in which 
  744.              GNAT stores entity names (see compilation unit Namet in the 
  745.              compiler sources for details). The third and fourth parameters are 
  746.              optionally used to distinguish between overloaded subprograms, in 
  747.              a manner similar to that used for the extended Import and Export 
  748.              pragmas, except that the subtype names are always given as string 
  749.              literals, again corresponding to the internal manner in which GNAT 
  750.              stores entity names. 
  751.  
  752.              The effect of the pragma is to allow the compiler to optionally 
  753.              eliminate the code or data associated with the named entity. If 
  754.              the declaration of the entity would have resulted in side effects, 
  755.              these side effects may or may not occur in the resulting program. 
  756.              Any reference to an eliminated entity may cause a compile time 
  757.              error, link time error, or incorrect results at runtime. 
  758.  
  759.              The intention of pragma Eliminate is to allow a program to be 
  760.              compiled in a system independent manner, with unused entities 
  761.              eliminated, without the requirement of modifying the source text. 
  762.              Normally the required set of Eliminate pragmas is constructed 
  763.              automatically using the gnatelim tool. 
  764.  
  765.              Note that the reason this pragma takes string literals where names 
  766.              might be expected is that a pragma Eliminate can appear in a 
  767.              context where the relevant names are not visible. 
  768.  
  769.  pragma Export_Exception 
  770.  
  771.            Syntax: 
  772.  
  773.                                               pragma Export_Exception (
  774.                                                  [Internal =>] LOCAL_NAME,
  775.                                                [, [External =>] EXTERNAL_SYMBOL,]
  776.                                                [, [Form   =>] Ada | VMS]
  777.                                                [, [Code   =>] static_integer_EXPRESSION]);
  778.                                               EXTERNAL_SYMBOL ::=
  779.                                                IDENTIFIER
  780.                                               | static_string_EXPRESSION
  781.  
  782.              This pragma is implemented only in the OpenVMS implementation of 
  783.              GNAT. It causes the specified exception to be propagated outside 
  784.              of the Ada program, so that it can be handled by programs written 
  785.              in other OpenVMS languages. This pragma establishes an external 
  786.              name for an Ada exception and makes the name available to the 
  787.              OpenVMS Linker as a global symbol. For further details on this 
  788.              pragma, see the DEC Ada Language Reference Manual, section 
  789.              13.9a3.2. 
  790.  
  791.  pragma Export_Function ┬╖┬╖┬╖ 
  792.  
  793.            Syntax: 
  794.  
  795.                                               pragma Export_Function (
  796.                                                  [Internal     =>] LOCAL_NAME,
  797.                                                [, [External     =>] EXTERNAL_SYMBOL]
  798.                                                [, [Parameter_Types  =>] PARAMETER_TYPES]
  799.                                                [, [Result_Type    =>] result_SUBTYPE_MARK]
  800.                                                [, [Mechanism     =>] MECHANISM]
  801.                                                [, [Result_Mechanism =>] MECHANISM_NAME]);
  802.                                               EXTERNAL_SYMBOL ::=
  803.                                                IDENTIFIER
  804.                                               | static_string_EXPRESSION
  805.                                               PARAMETER_TYPES ::=
  806.                                                null
  807.                                               | SUBTYPE_MARK {, SUBTYPE_MARK}
  808.                                               MECHANISM ::=
  809.                                                MECHANISM_NAME
  810.                                               | (MECHANISM_ASSOCIATION {, MECHANISM_ASSOCIATION})
  811.                                               MECHANISM_ASSOCIATION ::=
  812.                                                [formal_parameter_NAME =>] MECHANISM_NAME
  813.                                               MECHANISM_NAME ::=
  814.                                                Value
  815.                                               | Reference
  816.                                               | Descriptor [([Class =>] CLASS_NAME)]
  817.                                               CLASS_NAME ::= ubs | ubsb | uba | s | sb | a | nca
  818.  
  819.              Use this pragma to make a function externally callable and 
  820.              optionally provide information on mechanisms to be used for 
  821.              passing parameter and result values. We recommend, for the 
  822.              purposes of improving portability, this pragma always be used in 
  823.              conjunction with a separate pragma Export, which must precede the 
  824.              pragma Export_Function. GNAT does not require a separate pragma 
  825.              Export, but if none is present, Convention Ada is assumed, which 
  826.              is usually not what is wanted, so it is usually appropriate to use 
  827.              this pragma in conjunction with a Export or Convention pragma that 
  828.              specifies the desired foriegn convention. Pragma Export_Function 
  829.              (and Export, if present) must appear in the same declarative 
  830.              region as the function to which they apply. 
  831.  
  832.              internal_name must uniquely designate the function to which the 
  833.              pragma applies. If more than one function name exists of this name 
  834.              in the declarative part you must use the Parameter_Types and 
  835.              Result_Type parameters is mandatory to achieve the required unique 
  836.              designation. subtype_ marks in these parameters must exactly match 
  837.              the subtypes in the corresponding function specification, using 
  838.              positional notation to match parameters with subtype marks. 
  839.              Passing by descriptor is supported only on the OpenVMS ports of 
  840.              GNAT. 
  841.  
  842.  pragma Export_Object ┬╖┬╖┬╖ 
  843.  
  844.            Syntax: 
  845.  
  846.                                               pragma Export_Object
  847.                                                  [Internal =>] LOCAL_NAME,
  848.                                                 [, [External =>] EXTERNAL_SYMBOL]
  849.                                                 [, [Size   =>] EXTERNAL_SYMBOL]
  850.                                               EXTERNAL_SYMBOL ::=
  851.                                                IDENTIFIER
  852.                                               | static_string_EXPRESSION
  853.  
  854.              This pragma designates an object as exported, and apart from the 
  855.              extended rules for external symbols, is identical in effect to the 
  856.              use of the normal Export pragma applied to an object. You may use 
  857.              a separate Export pragma (and you probably should from the point 
  858.              of view of portability), but it is not required.  Size is syntax 
  859.              checked, but otherwise ignored by GNAT. 
  860.  
  861.  pragma Export_Procedure ┬╖┬╖┬╖ 
  862.  
  863.            Syntax: 
  864.  
  865.                                               pragma Export_Procedure (
  866.                                                  [Internal     =>] LOCAL_NAME
  867.                                                [, [External     =>] EXTERNAL_SYMBOL]
  868.                                                [, [Parameter_Types =>] PARAMETER_TYPES]
  869.                                                [, [Mechanism    =>] MECHANISM]);
  870.                                               EXTERNAL_SYMBOL ::=
  871.                                                IDENTIFIER
  872.                                               | static_string_EXPRESSION
  873.                                               PARAMETER_TYPES ::=
  874.                                                null
  875.                                               | SUBTYPE_MARK {, SUBTYPE_MARK}
  876.                                               MECHANISM ::=
  877.                                                MECHANISM_NAME
  878.                                               | (MECHANISM_ASSOCIATION {, MECHANISM_ASSOCIATION})
  879.                                               MECHANISM_ASSOCIATION ::=
  880.                                                [formal_parameter_NAME =>] MECHANISM_NAME
  881.                                               MECHANISM_NAME ::=
  882.                                                Value
  883.                                               | Reference
  884.                                               | Descriptor [([Class =>] CLASS_NAME)]
  885.                                               CLASS_NAME ::= ubs | ubsb | uba | s | sb | a | nca
  886.  
  887.              This pragma is identical to Export_Function except that it applies 
  888.              to a procedure rather than a function and the parameters 
  889.              Result_Type and Result_Mechanism are not permitted. GNAT does not 
  890.              require a separate pragma Export, but if none is present, 
  891.              Convention Ada is assumed, which is usually not what is wanted, so 
  892.              it is usually appropriate to use this pragma in conjunction with a 
  893.              Export or Convention pragma that specifies the desired foriegn 
  894.              convention. 
  895.  
  896.  pragma Export_Valued_Procedure 
  897.  
  898.            Syntax: 
  899.  
  900.                                               pragma Export_Valued_Procedure (
  901.                                                  [Internal     =>] LOCAL_NAME
  902.                                                [, [External     =>] EXTERNAL_SYMBOL]
  903.                                                [, [Parameter_Types =>] PARAMETER_TYPES]
  904.                                                [, [Mechanism    =>] MECHANISM]);
  905.                                               EXTERNAL_SYMBOL ::=
  906.                                                IDENTIFIER
  907.                                               | static_string_EXPRESSION
  908.                                               PARAMETER_TYPES ::=
  909.                                                null
  910.                                               | SUBTYPE_MARK {, SUBTYPE_MARK}
  911.                                               MECHANISM ::=
  912.                                                MECHANISM_NAME
  913.                                               | (MECHANISM_ASSOCIATION {, MECHANISM_ASSOCIATION})
  914.                                               MECHANISM_ASSOCIATION ::=
  915.                                                [formal_parameter_NAME =>] MECHANISM_NAME
  916.                                               MECHANISM_NAME ::=
  917.                                                Value
  918.                                               | Reference
  919.                                               | Descriptor [([Class =>] CLASS_NAME)]
  920.                                               CLASS_NAME ::= ubs | ubsb | uba | s | sb | a | nca
  921.  
  922.              This pragma is identical to Export_Procedure except that the first 
  923.              parameter of local_name, which must be present, must be of mode 
  924.              OUT, and externally the subprogram is treated as a function with 
  925.              this parameter as the result of the function. GNAT provides for 
  926.              this capability to allow the use of OUT and IN OUT parameters in 
  927.              interfacing to external functions (which are not permitted in Ada 
  928.              functions). GNAT does not require a separate pragma Export, but if 
  929.              none is present, Convention Ada is assumed, which is almost 
  930.              certainly not what is wanted since the whole point of this pragma 
  931.              is to interface with foreign language functions, so it is usually 
  932.              appropriate to use this pragma in conjunction with a Export or 
  933.              Convention pragma that specifies the desired foriegn convention. 
  934.  
  935.  pragma Extend_System 
  936.  
  937.            Syntax: 
  938.  
  939.                                               pragma Extend_System ([Name =>] IDENTIFIER);
  940.  
  941.              This pragma is used to provide backwards compatibility with other 
  942.              implementations that extend the facilities of package System. In 
  943.              GNAT, System contains only the definitions that are present in the 
  944.              Ada 95 RM. However, other implementations, notably the DEC Ada 83 
  945.              implementation, provide many extensions to package System. 
  946.  
  947.              For each such implementation accommodated by this pragma, GNAT 
  948.              provides a package Aux_xxx, e.g. Aux_DEC for the DEC Ada 83 
  949.              implementation, which provides the required additional 
  950.              definitions. You can use this package in two ways.  You can with 
  951.              it in the normal way and access entities either by selection or 
  952.              using a use clause. In this case no special processing is 
  953.              required. 
  954.  
  955.              However, if existing code contains references such as System.xxx 
  956.              where xxx is an entity in the extended definitions provided in 
  957.              package System, you may use this pragma to extend visibility in 
  958.              System in a non-standard way that provides greater compatibility 
  959.              with the existing code. Pragma Extend_System is a configuration 
  960.              pragma whose single argument is the name of the package containing 
  961.              the extended definition (e.g. Aux_DEC for the DEC Ada case). A 
  962.              unit compiled under control of this pragma will be processed using 
  963.              special visibility processing that looks in package System.Aux_xxx 
  964.              where Aux_xxx is the pragma argument for any entity referenced in 
  965.              package System, but not found in package System. 
  966.  
  967.  pragma External_Name_Casing 
  968.  
  969.            Syntax: 
  970.  
  971.                                               pragma External_Name_Casing (
  972.                                                Uppercase | Lowercase
  973.                                                [, Uppercase | Lowercase | As_Is);
  974.  
  975.              This pragma provides control over the casing of external names 
  976.              associated with Import and Export pragmas. There are two cases to 
  977.              consider: 
  978.  
  979.              Implicit external names 
  980.                          Implicit external names are derived from identifiers. 
  981.                          The most common case arises when a standard Ada 95 
  982.                          Import or Export pragma is used with only two 
  983.                          arguments, as in: 
  984.  
  985.                                                                         pragma Import (C, C_Routine);
  986.  
  987.                          Since Ada is a case insensitive language, the spelling 
  988.                          of the identifier in the Ada source program does not 
  989.                          provide any information on the desired casing of the 
  990.                          external name, and so a convention is needed. In GNAT 
  991.                          the default treatment is that such names are converted 
  992.                          to all lower case letters. This corresponds to the 
  993.                          normal C style in many environments. The first 
  994.                          argument of pragma External_Name_Casing can be used to 
  995.                          control this treatment. If Uppercase is specified, 
  996.                          then the name will be forced to all uppercase letters. 
  997.                          If Lowercase is specified, then the normal default of 
  998.                          all lower case letters will be used. 
  999.  
  1000.                          This same implicit treatment is also used in the case 
  1001.                          of extended DEC Ada 83 compatible Import and Export 
  1002.                          pragmas where an external name is explicitly specified 
  1003.                          using an identifier rather than a string. 
  1004.  
  1005.              Explicit external names 
  1006.                          Explicit external names are given as string literals. 
  1007.                          The most common case arises when a standard Ada 95 
  1008.                          Import or Export pragma is used with three arguments, 
  1009.                          as in: 
  1010.  
  1011.                                                                       pragma Import (C, C_Routine, "C_routine");
  1012.  
  1013.                          In this case, the string literal normally provides the 
  1014.                          exact casing required for the external name. The 
  1015.                          second argument of pragma External_Name_Casing may be 
  1016.                          used to modify this behavior. If Uppercase is 
  1017.                          specified, then the name will be forced to all 
  1018.                          uppercase letters. If Lowercase is specified, then the 
  1019.                          name will be forced to all lowercase letters. A 
  1020.                          specification of As_Is provides the normal default 
  1021.                          behavior in which the casing is taken from the string 
  1022.                          provided. 
  1023.  
  1024.  
  1025.              This pragma may appear anywhere that a pragma is valid. in 
  1026.              particular, it can be used as a configuration pragma in the 
  1027.              gnat.adc file, in which case it applies to all subsequent 
  1028.              compilations, or it can be used as a program unit pragma, in which 
  1029.              case it only applies to the current unit, or it can be used more 
  1030.              locally to control individual Import/Export pragmas. 
  1031.  
  1032.              It is primarily intended for use with OpenVMS systems, where many 
  1033.              compilers convert all symbols to upper case by default. For 
  1034.              interfacing to such compilers (e.g. the DEC C compiler), it may be 
  1035.              convenient to use the pragma: 
  1036.  
  1037.                                               pragma External_Name_Casing (Uppercase, Uppercase);
  1038.  
  1039.              to enforce the upper casing of all external symbols. 
  1040.  
  1041.  pragma Finalize_Storage_Only 
  1042.  
  1043.            Syntax: 
  1044.  
  1045.                                               pragma Finalize_Storage_Only (first_subtype_LOCAL_NAME);
  1046.  
  1047.              This pragma allows the compiler not to emit a Finalize call for 
  1048.              objects defined at the library level. This is mostly useful for 
  1049.              types where finalization is only used to deal with storage 
  1050.              reclamation since in most environments it is not necessary to 
  1051.              reclaim memory just before terminating execution, hence the name. 
  1052.  
  1053.  pragma Float_Representation 
  1054.  
  1055.            Syntax: 
  1056.  
  1057.                                               pragma Float_Representation (FLOAT_REP);
  1058.                                               FLOAT_REP ::= VAX_Float | IEEE_Float
  1059.  
  1060.              This pragma is implemented only in the OpenVMS implementation of 
  1061.              GNAT. It allows control over the internal representation chosen 
  1062.              for the predefined floating point types declared in the packages 
  1063.              Standard and System. For further details on this pragma, see the 
  1064.              DEC Ada Language Reference Manual, section 3.5.7a. Note that to 
  1065.              use this pragma, the standard runtime libraries must be 
  1066.              recompiled. See the description of the GNAT LIBRARY command in the 
  1067.              OpenVMS version of the GNAT Users Guide for details on the use of 
  1068.              this command. 
  1069.  
  1070.  pragma Ident 
  1071.  
  1072.            Syntax: 
  1073.  
  1074.                                               pragma Ident (static_string_EXPRESSION);
  1075.  
  1076.              This pragma provides a string identification in the generated 
  1077.              object file, if the system supports the concept of this kind of 
  1078.              identification string. The maximum permitted length of the string 
  1079.              literal is 31 characters. This pragma is allowed only in the 
  1080.              outermost declarative part or declarative items of a compilation 
  1081.              unit. On OpenVMS systems, the effect of the pragma is identical to 
  1082.              the effect of the DEC Ada 83 pragma of the same name. 
  1083.  
  1084.  pragma Import_Exception 
  1085.  
  1086.            Syntax: 
  1087.  
  1088.                                               pragma Import_Exception (
  1089.                                                  [Internal =>] LOCAL_NAME,
  1090.                                                [, [External =>] EXTERNAL_SYMBOL,]
  1091.                                                [, [Form   =>] Ada | VMS]
  1092.                                                [, [Code   =>] static_integer_EXPRESSION]);
  1093.                                               EXTERNAL_SYMBOL ::=
  1094.                                                IDENTIFIER
  1095.                                               | static_string_EXPRESSION
  1096.  
  1097.              This pragma is implemented only in the OpenVMS implementation of 
  1098.              GNAT. It allows OpenVMS conditions (for example, from OpenVMS 
  1099.              system services or other OpenVMS languages) to be propagated to 
  1100.              Ada programs as Ada exceptions. The pragma specifies that the 
  1101.              exception associated with an exception declaration in an Ada 
  1102.              program be defined externally (in non-Ada code). For further 
  1103.              details on this pragma, see the DEC Ada Language Reference Manual, 
  1104.              section 13.9a.3.1. 
  1105.  
  1106.  pragma Import_Function ┬╖┬╖┬╖ 
  1107.  
  1108.            Syntax: 
  1109.  
  1110.                                               pragma Import_Function (
  1111.                                                  [Internal         =>] LOCAL_NAME,
  1112.                                                [, [External         =>] EXTERNAL_SYMBOL]
  1113.                                                [, [Parameter_Types      =>] PARAMETER_TYPES]
  1114.                                                [, [Result_Type        =>] SUBTYPE_MARK]
  1115.                                                [, [Mechanism         =>] MECHANISM]
  1116.                                                [, [Result_Mechanism     =>] MECHANISM_NAME]
  1117.                                                [, [First_Optional_Parameter =>] IDENTIFIER]);
  1118.                                               EXTERNAL_SYMBOL ::=
  1119.                                                IDENTIFIER
  1120.                                               | static_string_EXPRESSION
  1121.                                               PARAMETER_TYPES ::=
  1122.                                                null
  1123.                                               | SUBTYPE_MARK {, SUBTYPE_MARK}
  1124.                                               MECHANISM ::=
  1125.                                                MECHANISM_NAME
  1126.                                               | (MECHANISM_ASSOCIATION {, MECHANISM_ASSOCIATION})
  1127.                                               MECHANISM_ASSOCIATION ::=
  1128.                                                [formal_parameter_NAME =>] MECHANISM_NAME
  1129.                                               MECHANISM_NAME ::=
  1130.                                                Value
  1131.                                               | Reference
  1132.                                               | Descriptor [([Class =>] CLASS_NAME)]
  1133.                                               CLASS_NAME ::= ubs | ubsb | uba | s | sb | a | nca
  1134.  
  1135.              This pragma is used in conjunction with a pragma Import to specify 
  1136.              additional information for an imported function. The pragma Import 
  1137.              (or equivalent pragma Interface) must precede the Import_Function 
  1138.              pragma and both must appear in the same declarative part as the 
  1139.              function specification. 
  1140.  
  1141.              The Internal_Name argument must uniquely designate the function to 
  1142.              which the pragma applies. If more than one function name exists of 
  1143.              this name in the declarative part you must use the Parameter_Types 
  1144.              and Result_Type parameters to achieve the required unique 
  1145.              designation. Subtype marks in these parameters must exactly match 
  1146.              the subtypes in the corresponding function specification, using 
  1147.              positional notation to match parameters with subtype marks. 
  1148.  
  1149.              You may optionally use the Mechanism and Result_Mechanism 
  1150.              parameters to specify passing mechanisms for the parameters and 
  1151.              result. If you specify a single mechanism name, it applies to all 
  1152.              parameters.  Otherwise you may specify a mechanism on a parameter 
  1153.              by parameter basis using either positional or named notation. If 
  1154.              the mechanism is not specified, the default mechanism is used. 
  1155.  
  1156.              Passing by descriptor is supported only on the to OpenVMS ports of 
  1157.              GNAT 
  1158.  
  1159.              First_Optional_Parameter applies only to OpenVMS ports of GNAT. It 
  1160.              specifies that the designated parameter and all following 
  1161.              parameters are optional, meaning that they are not passed at the 
  1162.              generated code level (this is distinct from the notion of optional 
  1163.              parameters in Ada where the parameters are passed anyway with the 
  1164.              designated optional parameters). All optional parameters must be 
  1165.              of mode IN and have default parameter values that are either known 
  1166.              at compile time expressions, or uses of the 'Null_Parameter 
  1167.              attribute. 
  1168.  
  1169.  pragma Import_Object 
  1170.  
  1171.            Syntax: 
  1172.  
  1173.                                               pragma Import_Object
  1174.                                                  [Internal =>] LOCAL_NAME,
  1175.                                                [, [External =>] EXTERNAL_SYMBOL],
  1176.                                                [, [ Size   =>] EXTERNAL_SYMBOL])
  1177.                                               EXTERNAL_SYMBOL ::=
  1178.                                                IDENTIFIER
  1179.                                               | static_string_EXPRESSION
  1180.  
  1181.              This pragma designates an object as imported, and apart from the 
  1182.              extended rules for external symbols, is identical in effect to the 
  1183.              use of the normal Import pragma applied to an object.  Unlike the 
  1184.              subprogram case, you need not use a separate Import pragma, 
  1185.              although you may do so (and probably should do so from a 
  1186.              portability point of view). size is syntax checked, but otherwise 
  1187.              ignored by GNAT. 
  1188.  
  1189.  pragma Import_Procedure 
  1190.  
  1191.            Syntax: 
  1192.  
  1193.                                               pragma Import_Procedure (
  1194.                                                  [Internal         =>] LOCAL_NAME,
  1195.                                                [, [External         =>] EXTERNAL_SYMBOL]
  1196.                                                [, [Parameter_Types      =>] PARAMETER_TYPES]
  1197.                                                [, [Mechanism         =>] MECHANISM]
  1198.                                                [, [First_Optional_Parameter =>] IDENTIFIER]);
  1199.                                               EXTERNAL_SYMBOL ::=
  1200.                                                IDENTIFIER
  1201.                                               | static_string_EXPRESSION
  1202.                                               PARAMETER_TYPES ::=
  1203.                                                null
  1204.                                               | SUBTYPE_MARK {, SUBTYPE_MARK}
  1205.                                               MECHANISM ::=
  1206.                                                MECHANISM_NAME
  1207.                                               | (MECHANISM_ASSOCIATION {, MECHANISM_ASSOCIATION})
  1208.                                               MECHANISM_ASSOCIATION ::=
  1209.                                                [formal_parameter_NAME =>] MECHANISM_NAME
  1210.                                               MECHANISM_NAME ::=
  1211.                                                Value
  1212.                                               | Reference
  1213.                                               | Descriptor [([Class =>] CLASS_NAME)]
  1214.                                               CLASS_NAME ::= ubs | ubsb | uba | s | sb | a | nca
  1215.  
  1216.              This pragma is identical to Import_Function except that it applies 
  1217.              to a procedure rather than a function and the parameters 
  1218.              Result_Type and Result_Mechanism are not permitted. 
  1219.  
  1220.  pragma Import_Valued_Procedure ┬╖┬╖┬╖ 
  1221.  
  1222.            Syntax: 
  1223.  
  1224.                                               pragma Import_Valued_Procedure (
  1225.                                                  [Internal         =>] LOCAL_NAME,
  1226.                                                [, [External         =>] EXTERNAL_SYMBOL]
  1227.                                                [, [Parameter_Types      =>] PARAMETER_TYPES]
  1228.                                                [, [Mechanism         =>] MECHANISM]
  1229.                                                [, [First_Optional_Parameter =>] IDENTIFIER]);
  1230.                                               EXTERNAL_SYMBOL ::=
  1231.                                                IDENTIFIER
  1232.                                               | static_string_EXPRESSION
  1233.                                               PARAMETER_TYPES ::=
  1234.                                                null
  1235.                                               | SUBTYPE_MARK {, SUBTYPE_MARK}
  1236.                                               MECHANISM ::=
  1237.                                                MECHANISM_NAME
  1238.                                               | (MECHANISM_ASSOCIATION {, MECHANISM_ASSOCIATION})
  1239.                                               MECHANISM_ASSOCIATION ::=
  1240.                                                [formal_parameter_NAME =>] MECHANISM_NAME
  1241.                                               MECHANISM_NAME ::=
  1242.                                                Value
  1243.                                               | Reference
  1244.                                               | Descriptor [([Class =>] CLASS_NAME)]
  1245.                                               CLASS_NAME ::= ubs | ubsb | uba | s | sb | a | nca
  1246.  
  1247.              This pragma is identical to Import_Procedure except that the first 
  1248.              parameter of local_name, which must be present, must be of mode 
  1249.              OUT, and externally the subprogram is treated as a function with 
  1250.              this parameter as the result of the function. The purpose of this 
  1251.              capability is to allow the use of OUT and IN OUT parameters in 
  1252.              interfacing to external functions (which are not permitted in Ada 
  1253.              functions).  You may optionally use the Mechanism parameters to 
  1254.              specify passing mechanisms for the parameters. If you specify a 
  1255.              single mechanism name, it applies to all parameters. Otherwise you 
  1256.              may specify a mechanism on a parameter by parameter basis using 
  1257.              either positional or named notation. If the mechanism is not 
  1258.              specified, the default mechanism is used. 
  1259.  
  1260.              Note that it is important to use this pragma in conjunction with a 
  1261.              separate pragma Import that specifies the desired convention, 
  1262.              since otherwise the default convention is Ada, which is almost 
  1263.              certainly not what is required. 
  1264.  
  1265.  pragma Inline_Always 
  1266.  
  1267.            Syntax: 
  1268.  
  1269.                                               pragma Inline_Always (NAME [, NAME]);
  1270.  
  1271.              Similar to pragma  Inline except that inlining is not subject to 
  1272.              the use of option -gnatn for inter-unit inlining. 
  1273.  
  1274.  pragma Inline_Generic 
  1275.  
  1276.            Syntax: 
  1277.  
  1278.                                               pragma Inline_Generic (generic_package_NAME)
  1279.  
  1280.              This is implemented for compatibility with DEC Ada 83 and is 
  1281.              recognized, but otherwise ignored, by GNAT. All generic 
  1282.              instantiations are inlined by default when using GNAT. 
  1283.  
  1284.  pragma Interface 
  1285.  
  1286.            Syntax: 
  1287.  
  1288.                                               pragma Interface (
  1289.                                                  [Convention   =>] convention_identifier,
  1290.                                                  [Entity =>] local_name
  1291.                                                [, [External_Name =>] static_string_expression],
  1292.                                                [, [Link_Name   =>] static_string_expression]);
  1293.  
  1294.              This pragma is identifical in syntax and semantics to the standard 
  1295.              Ada 95 pragma Import. It is provided for compatibility with Ada 
  1296.              83. The definition is upwards compatible both with pragma 
  1297.              Interface as defined in the Ada 83 Reference Manual, and also with 
  1298.              some extended implementations of this pragma in certain Ada 83 
  1299.              implementations. 
  1300.  
  1301.  pragma Interface_Name 
  1302.  
  1303.            Syntax: 
  1304.  
  1305.                                               pragma Interface_Name (
  1306.                                                  [Entity     =>] LOCAL_NAME
  1307.                                                [, [External_Name =>] static_string_EXPRESSION]
  1308.                                                [, [Link_Name   =>] static_string_EXPRESSION]);
  1309.  
  1310.              This pragma provides an alternative way of specifying the 
  1311.              interface name for an interfaced subprogram, and is provided for 
  1312.              compatibility with Ada 83 compilers that use the pragma for this 
  1313.              purpose. You must provide at least one of External_Name or 
  1314.              Link_Name. 
  1315.  
  1316.  pragma Linker_Alias 
  1317.  
  1318.            Syntax: 
  1319.  
  1320.                                               pragma Linker_Alias (
  1321.                                                [Entity =>] LOCAL_NAME
  1322.                                                [Alias  =>] static_string_EXPRESSION);
  1323.  
  1324.              This pragma establishes a linker alias for the given named entity. 
  1325.              For further details on the exact effect, consult the GCC manual. 
  1326.  
  1327.  pragma Linker_Section 
  1328.  
  1329.            Syntax: 
  1330.  
  1331.                                               pragma Linker_Section (
  1332.                                                [Entity  =>] LOCAL_NAME
  1333.                                                [Section =>] static_string_EXPRESSION);
  1334.  
  1335.              This pragma specifies the name of the linker section for the given 
  1336.              entity. For further details on the exact effect, consult the GCC 
  1337.              manual. 
  1338.  
  1339.  pragma No_Run_Time 
  1340.  
  1341.            Syntax: 
  1342.  
  1343.                                               pragma No_Run_Time;
  1344.  
  1345.              This is a configuration pragma that makes sure the user code does 
  1346.              not use nor need anything from the GNAT run time. This is mostly 
  1347.              useful in context where code certification is required. Please 
  1348.              consult the GNORT product documentation for additional 
  1349.              information. 
  1350.  
  1351.  pragma Normalize_Scalars 
  1352.  
  1353.            Syntax: 
  1354.  
  1355.                                               pragma Normalize_Scalars;
  1356.  
  1357.              This is a language defined pragma which is fully implemented in 
  1358.              GNAT. The effect is to cause all scalar objects that are not 
  1359.              otherwise initialized to be initialized. The initial values are 
  1360.              implementation dependent and are as follows: 
  1361.  
  1362.              Standard.Character 
  1363.  
  1364.                          Objects whose root type is Standard.Character are 
  1365.                          initialized to Character'Last. This will be out of 
  1366.                          range of the subtype only if the subtype range 
  1367.                          excludes this value. 
  1368.  
  1369.              Standard.Wide_Character 
  1370.  
  1371.                          Objects whose root type is Standard.Wide_Character are 
  1372.                          initialized to Wide_Character'Last. This will be out 
  1373.                          of range of the subtype only if the subtype range 
  1374.                          excludes this value. 
  1375.  
  1376.              Integer types 
  1377.  
  1378.                          Objects of an integer type are initialized to 
  1379.                          base_type'First, where base_type is the base type of 
  1380.                          the object type. This will be out of range of the 
  1381.                          subtype only if the subtype range excludes this value. 
  1382.                          For example, if you declare the subtype: 
  1383.  
  1384.                                                                       subtype Ityp is integer range 1 ┬╖┬╖ 10;
  1385.  
  1386.                          then objects of type x will be initialized to 
  1387.                          Integer'First, a negative number that is certainly 
  1388.                          outside the range of subtype Ityp. 
  1389.  
  1390.              Real types 
  1391.                          Objects of all real types (fixed and floating) are 
  1392.                          initialized to base_type'First, where base_Type is the 
  1393.                          base type of the object type. This will be out of 
  1394.                          range of the subtype only if the subtype range 
  1395.                          excludes this value. 
  1396.  
  1397.              Modular types 
  1398.                          Objects of a modular type are initialized to typ'Last. 
  1399.                          This will be out of range of the subtype only if the 
  1400.                          subtype excludes this value. 
  1401.  
  1402.              Enumeration types 
  1403.                          Objects of an enumeration type are initialized to all 
  1404.                          one-bits, i.e. to the value 2 ** typ'Size - 1. This 
  1405.                          will be out of range of the enumeration subtype in all 
  1406.                          cases except where the subtype contains exactly 2**8, 
  1407.                          2**16, or 2**32. 
  1408.  
  1409.  pragma Long_Float 
  1410.  
  1411.            Syntax: 
  1412.  
  1413.                                               pragma Long_Float (FLOAT_FORMAT);
  1414.                                               FLOAT_FORMAT ::= D_Float | G_Float
  1415.  
  1416.              This pragma is implemented only in the OpenVMS implementation of 
  1417.              GNAT. It allows control over the internal representation chosen 
  1418.              for the predefined type Long_Float and for floating point type 
  1419.              representations with digits specified in the range 7 ┬╖┬╖ 15. For 
  1420.              further details on this pragma, see the DEC Ada Language Reference 
  1421.              Manual, section 3.5.7b. Note that to use this pragma, the standard 
  1422.              runtime libraries must be recompiled. See the description of the 
  1423.              GNAT LIBRARY command in the OpenVMS version of the GNAT Users 
  1424.              Guide for details on the use of this command. 
  1425.  
  1426.  pragma Machine_Attribute ┬╖┬╖┬╖ 
  1427.  
  1428.            Syntax: 
  1429.  
  1430.                                               pragma Machine_Attribute (
  1431.                                                [Attribute_Name =>] string_EXPRESSION,
  1432.                                                [Entity     =>] LOCAL_NAME);
  1433.  
  1434.              Machine dependent attributes can be specified for types and/or 
  1435.              declarations. Currently only subprogram entities are supported. 
  1436.              This pragma is semantically equivalent to __attribute__(( 
  1437.              string_expression)) in GNU C, where string_expression> is 
  1438.              recognized by the GNU C macros VALID_MACHINE_TYPE_ATTRIBUTE and 
  1439.              VALID_MACHINE_DECL_ATTRIBUTE which are defined in the 
  1440.              configuration header file 'tm.h' for each machine.  See the GCC 
  1441.              manual for further information. 
  1442.  
  1443.  pragma Main_Storage 
  1444.  
  1445.            Syntax: 
  1446.  
  1447.                                               pragma Main_Storage
  1448.                                                (MAIN_STORAGE_OPTION [, MAIN_STORAGE_OPTION]);
  1449.                                               MAIN_STORAGE_OPTION ::=
  1450.                                                [WORKING_STORAGE =>] static_SIMPLE_EXPRESSION
  1451.                                               | [TOP_GUARD    =>] static_SIMPLE_EXPRESSION
  1452.  
  1453.              This pragma is provided for compatibility with OpenVMS Vax 
  1454.              Systems. It has no effect in GNAT, other than being syntax 
  1455.              checked. Note that the pragma also has no effect in DEC Ada 83 for 
  1456.              OpenVMS Alpha Systems. 
  1457.  
  1458.  pragma No_Return 
  1459.  
  1460.            Syntax: 
  1461.  
  1462.                                               pragma No_Return (procedure_LOCAL_NAME);
  1463.  
  1464.              procedure_local_NAME must refer to one or more procedure 
  1465.              declarations in the current declarative part. A procedure to which 
  1466.              this pragma is applied may not contain any explicit return 
  1467.              statements, and also may not contain any implicit return 
  1468.              statements from falling off the end of a statement sequence. One 
  1469.              use of this pragma is to identify procedures whose only purpose is 
  1470.              to raise an exception. 
  1471.  
  1472.              Another use of this pragma is to suppress incorrect warnings about 
  1473.              missing returns in functions, where the last statement of a 
  1474.              function statement sequence is a call to such a procedure. 
  1475.  
  1476.  pragma Passive 
  1477.  
  1478.            Syntax: 
  1479.  
  1480.                                               pragma Passive ([Semaphore | No]);
  1481.  
  1482.              Syntax checked, but otherwise ignored by GNAT. This is recognized 
  1483.              for compatibility with DEC Ada 83 implementations, where it is 
  1484.              used within a task definition to request that a task be made 
  1485.              passive.  If the argument Semaphore is present, or no argument is 
  1486.              omitted, then DEC Ada 83 treats the pragma as an assertion that 
  1487.              the containing task is passive and that optimization of context 
  1488.              switch with this task is permitted and desired.  If the argument 
  1489.              No is present, the task must not be optimized. GNAT does not 
  1490.              attempt to optimize any tasks in this manner (since protected 
  1491.              objects are available in place of passive tasks). 
  1492.  
  1493.  pragma Polling 
  1494.  
  1495.            Syntax: 
  1496.  
  1497.                                               pragma Polling (ON | OFF);
  1498.  
  1499.              This pragma controls the generation of polling code. This is 
  1500.              normally off. If pragma Polling (ON) is used then periodic calls 
  1501.              are generated to the routine Ada.Exceptions.Poll. This routine is 
  1502.              a separate unit in the runtime library, and can be found in file 
  1503.              a-excpol.adb. 
  1504.  
  1505.              Pragma polling can appear as a configuration pragma (for example 
  1506.              it can be placed in the gnat.adc file) to enable polling globally, 
  1507.              or it can be used in the statement or declaration sequence to 
  1508.              control polling more locally. 
  1509.  
  1510.              A call to the polling routine is generated at the start of every 
  1511.              loop and at the start of every subprogram call. This guarantees 
  1512.              that the Poll routine is called frequently, and places an upper 
  1513.              bound (determined by the complexity of the code) on the period 
  1514.              between two Poll calls. 
  1515.  
  1516.              The primary purpose of the polling interface is to enable 
  1517.              asynchronous aborts on targets that cannot otherwise support it 
  1518.              (for example Windows NT), but it may be used for any other purpose 
  1519.              requiring periodic polling. The standard version is null, and can 
  1520.              be replaced by a user program. This will require re-compilation of 
  1521.              the Ada.Exceptions package that can be found in files 
  1522.              a-except.ads/adb. 
  1523.  
  1524.              A standard alternative unit (called 4wexcpol.adb in the standard 
  1525.              GNAT distribution) is used to enable the asynchronous abort 
  1526.              capability on targets that do not normally support the capability. 
  1527.              The version of Poll in this file makes a call to the appropriate 
  1528.              runtime routine to test for an abort condition. 
  1529.  
  1530.              Note that polling can also be enabled by use of the -gnatP switch. 
  1531.              See the GNAT User's Guide for details. 
  1532.  
  1533.  pragma Propagate_Exceptions 
  1534.  
  1535.            Syntax: 
  1536.  
  1537.                                               pragma Propagate_Exceptions (subprogram_LOCAL_NAME);
  1538.  
  1539.              This pragma indicates that the given entity, which is the name of 
  1540.              an imported foreign-langauge subprogram may receive an Ada 
  1541.              exception, and that the exception should be propagated. It is 
  1542.              relevant only if zero cost exception handling is in use, and is 
  1543.              thus never needed if the alternative longjmp/setjmp implementation 
  1544.              of exceptions is used (although it is harmless to use it in such 
  1545.              cases). 
  1546.  
  1547.              The implementation of fast exceptions always properly propagates 
  1548.              exceptions through Ada code, as described in the Ada Reference 
  1549.              Manual. However, this manual is silent about the propagation of 
  1550.              exceptions through foreign code. For example, consider the 
  1551.              situation where P1 calls P2, and P2 calls P3, where P1 and P3 are 
  1552.              in Ada, but P2 is in C. P3 raises an Ada exception. The question 
  1553.              is whether or not it will be propagated through P2 and can be 
  1554.              handled in P1. 
  1555.  
  1556.              For the longjmp/setjmp implementation of exceptions, the answer is 
  1557.              always yes. For some targets on which zero cost exception handling 
  1558.              is implemented, the answer is also always yes. However, there are 
  1559.              some targets, notably in the current version all x86 architecture 
  1560.              targets, in which the answer is that such propagation does not 
  1561.              happen automatically. If such propagation is required on these 
  1562.              targets, it is mandatory to use Propagate_Exceptions to name all 
  1563.              foreign language routines through which Ada exceptions may be 
  1564.              propagated. 
  1565.  
  1566.  pragma Psect_Object 
  1567.  
  1568.            Syntax: 
  1569.  
  1570.                                               pragma Psect_Object
  1571.                                                  [Internal =>] LOCAL_NAME,
  1572.                                                [, [External =>] EXTERNAL_SYMBOL]
  1573.                                                [, [Size   =>] EXTERNAL_SYMBOL]
  1574.                                               EXTERNAL_SYMBOL ::=
  1575.                                                IDENTIFIER
  1576.                                               | static_string_EXPRESSION
  1577.  
  1578.              This pragma is identical in effect to pragma Common_Object. 
  1579.  
  1580.  Pure_Function 
  1581.  
  1582.            Syntax: 
  1583.  
  1584.                                               pragma Pure_Function ([Entity =>] function_LOCAL_NAME);
  1585.  
  1586.              This pragma appears in the same declarative part as a function 
  1587.              declaration (or a set of function declarations if more than one 
  1588.              overloaded declaration exists, in which case the pragma applies to 
  1589.              all entities). If specifies that the function Entity is to be 
  1590.              considered pure for the purposes of code generation. This means 
  1591.              that the compiler can assume that there are no side effects, and 
  1592.              in particular that two calls with identical arguments produce the 
  1593.              same result. It also means that the function can be used in an 
  1594.              address clause. 
  1595.  
  1596.              Note that, quite deliberately, there are no static checks to try 
  1597.              to ensure that this promise is met, so Pure_Function can be used 
  1598.              with functions that are conceptually pure, even if they do modify 
  1599.              global variables. For example, a square root function that is 
  1600.              instrumented to count the number of times it is called is still 
  1601.              conceptually pure, and can still be optimized, even though it 
  1602.              modifies a global variable (the count). Memo functions are another 
  1603.              example (where a table of previous calls is kept and consulted to 
  1604.              avoid re-computation). 
  1605.  
  1606.              Note: All functions in a Pure package are automatically pure, and 
  1607.              there is no need to use pragma Pure_Function in this case. 
  1608.  
  1609.              Note: If pragma Pure_Function is applied to a renamed function, it 
  1610.              applies to the underlying renamed function. This can be used to 
  1611.              disambiguate cases of overloading where some but not all functions 
  1612.              in a set of overloaded functions are to be designated as pure. 
  1613.  
  1614.  pragma Ravenscar 
  1615.  
  1616.            Syntax: 
  1617.  
  1618.                                               pragma Ravenscar
  1619.  
  1620.              A configuration pragma that establishes the following set of 
  1621.              restrictions: 
  1622.  
  1623.              No_Abort_Statements 
  1624.                          [RM D.7] There are no abort_statements, and there are 
  1625.                          no calls to Task_Identification.Abort_Task. 
  1626.  
  1627.              No_Select_Statements 
  1628.                          There are no select_statements. 
  1629.  
  1630.              No_Task_Hierarchy 
  1631.                          [RM D.7] All (non-environment) tasks depend directly 
  1632.                          on the environment task of the partition. 
  1633.  
  1634.              No_Task_Allocators 
  1635.                          [RM D.7] There are no allocators for task types or 
  1636.                          types containing task subcomponents. 
  1637.  
  1638.              No_Dynamic_Priorities 
  1639.                          [RM D.7] There are no semantic dependencies on the 
  1640.                          package Dynamic_Priorities. 
  1641.  
  1642.              No_Terminate_Alternatives 
  1643.                          [RM D.7] There are no selective_accepts with 
  1644.                          terminate_alternatives 
  1645.  
  1646.              No_Dynamic_Interrupts 
  1647.                          There are no semantic dependencies on Ada.Interrupts. 
  1648.  
  1649.              No_Protected_Type_Allocators 
  1650.                          There are no allocators for protected types or types 
  1651.                          containing protected subcomponents. 
  1652.  
  1653.              No_Local_Protected_Objects 
  1654.                          Protected objects and access types that designate such 
  1655.                          objects shall be declared only at library level. 
  1656.  
  1657.              No_Requeue 
  1658.                          Requeue statements are not allowed. 
  1659.  
  1660.              No_Calendar 
  1661.                          There are no semantic dependencies on the package 
  1662.                          Ada.Calendar. 
  1663.  
  1664.              No_Relative_Delay 
  1665.                          There are no delay_relative_statements. 
  1666.  
  1667.              No_Task_Attributes 
  1668.                          There are no semantic dependencies on the 
  1669.                          Ada.Task_Attributes package and there are no 
  1670.                          references to the attributes Callable and Terminated 
  1671.                          [RM 9.9]. 
  1672.  
  1673.              Static_Storage_Size 
  1674.                          The expression for pragma Storage_Size is static. 
  1675.  
  1676.              Boolean_Entry_Barriers 
  1677.                          Entry barrier condition expressions shall be boolean 
  1678.                          objects which are declared in the protected type which 
  1679.                          contains the entry. 
  1680.  
  1681.              Max_Asynchronous_Select_Nesting = 0 
  1682.                          [RM D.7] Specifies the maximum dynamic nesting level 
  1683.                          of asynchronous_selects. A value of zero prevents the 
  1684.                          use of any asynchronous_select. 
  1685.  
  1686.              Max_Task_Entries = 0 
  1687.                          [RM D.7] Specifies the maximum number of entries per 
  1688.                          task.  The bounds of every entry family of a task unit 
  1689.                          shall be static, or shall be defined by a discriminant 
  1690.                          of a subtype whose corresponding bound is static.  A 
  1691.                          value of zero indicates that no rendezvous are 
  1692.                          possible.  For the Ravenscar pragma, the value of 
  1693.                          Max_Task_Entries is always 0 (zero). 
  1694.  
  1695.              Max_Protected_Entries = 1 
  1696.                          [RM D.7] Specifies the maximum number of entries per 
  1697.                          protected type.  The bounds of every entry family of a 
  1698.                          protected unit shall be static, or shall be defined by 
  1699.                          a discriminant of a subtype whose corresponding bound 
  1700.                          is static.  For the Ravenscar pragma the value of 
  1701.                          Max_Protected_Entries is always 1. 
  1702.  
  1703.              Max_Select_Alternatives = 0 
  1704.                          [RM D.7] Specifies the maximum number of alternatives 
  1705.                          in a selective_accept. For the Ravenscar pragma the 
  1706.                          value if always 0. 
  1707.  
  1708.              No_Task_Termination 
  1709.                          Tasks which terminate are erroneous. 
  1710.  
  1711.              No_Entry_Queue 
  1712.                          No task can be queued on a protected entry. Note that 
  1713.                          this restrictions is checked at run time. The 
  1714.                          violation of this restriction generates a 
  1715.                          Program_Error exception. 
  1716.  
  1717.  
  1718.              This set of restrictions corresponds to the definition of the 
  1719.              "Ravenscar Profile" for limited tasking, devised and published by 
  1720.              the International Workshop On Real Time Ada", 1997. 
  1721.  
  1722.              The above set is a superset of the restrictions provided by pragma 
  1723.              Restricted_Run_Time, it includes six additional restrictions 
  1724.              (Boolean_Entry_Barriers, No_Select_Statements, No_Calendar, 
  1725.              Static_Storage_Size, No_Relative_Delay and No_Task_Termination). 
  1726.              This means that pragma Ravenscar, like the pragma 
  1727.              Restricted_Run_Time, automatically causes the use of a simplified, 
  1728.              more efficient version of the tasking run-time system. 
  1729.  
  1730.  pragma Restricted_Run_Time 
  1731.  
  1732.            Syntax: 
  1733.  
  1734.                                               pragma Restricted_Run_Time
  1735.  
  1736.              A configuration pragma that establishes the following set of 
  1737.              restrictions: 
  1738.  
  1739.                1. No_Abort_Statements 
  1740.  
  1741.                2. No_Asynchronous_Control 
  1742.  
  1743.                3. No_Entry_Queue 
  1744.  
  1745.                4. No_Task_Hierarchy 
  1746.  
  1747.                5. No_Task_Allocators 
  1748.  
  1749.                6. No_Dynamic_Priorities 
  1750.  
  1751.                7. No_Terminate_Alternatives 
  1752.  
  1753.                8. No_Dynamic_Interrupts 
  1754.  
  1755.                9. No_Protected_Type_Allocators 
  1756.  
  1757.                10.No_Local_Protected_Objects 
  1758.  
  1759.                11.No_Requeue 
  1760.  
  1761.                12.No_Task_Attributes 
  1762.  
  1763.                13.Max_Asynchronous_Select_Nesting =  0 
  1764.  
  1765.                14.Max_Task_Entries =  0 
  1766.  
  1767.                15.Max_Protected_Entries = 1 
  1768.  
  1769.                16.Max_Select_Alternatives = 0 
  1770.  
  1771.  
  1772.              This set of restrictions causes the automatic selection of a 
  1773.              simplified version of the run time that provides improved 
  1774.              performance for the limited set of tasking functionality permitted 
  1775.              by this set of restrictions. 
  1776.  
  1777.  pragma Share_Generic 
  1778.  
  1779.            Syntax: 
  1780.  
  1781.                                               pragma Share_Generic (NAME {, NAME});
  1782.  
  1783.              This pragma is recognized for compatibility with other Ada 
  1784.              compilers but is ignored by GNAT. GNAT does not provide the 
  1785.              capability for sharing of generic code. All generic instantiations 
  1786.              result in making an inlined copy of the template with appropriate 
  1787.              substitutions. 
  1788.  
  1789.  pragma Source_File_Name 
  1790.  
  1791.            Syntax: 
  1792.  
  1793.                                               pragma Source_File_Name (
  1794.                                                [Unit_Name  =>] unit_NAME,
  1795.                                                [FNAME_DESIG =>] STRING_LITERAL);
  1796.                                               FNAME_DESIG => Body_File_Name | Spec_File_Name
  1797.  
  1798.              Use this to override the normal naming convention. It is a 
  1799.              configuration pragma, and so has the usual applicability of 
  1800.              configuration pragmas (i.e. it applies to either an entire 
  1801.              partition, or to all units in a compilation, or to a single unit, 
  1802.              depending on how it is used. unit_name is mapped to 
  1803.              file_name_literal. The identifier for the second argument is 
  1804.              required, and indicates whether this is the file name for the spec 
  1805.              or for the body. 
  1806.  
  1807.              Another form of this pragma allows separate names to be specified 
  1808.              for a body (other than a subunit) and a subunit: 
  1809.  
  1810.                                               pragma Source_File_Name (
  1811.                                                [Unit_Name     =>] unit_NAME,
  1812.                                                Body_File_Name   => STRING_LITERAL,
  1813.                                                Subunit_File_Name => STRING_LITERAL);
  1814.  
  1815.              This form permits a given compilation environment to contain both 
  1816.              a subunit and, for example, a package body of the same name. The 
  1817.              Ada Reference Manual permits environments to contain both files, 
  1818.              although only one of them may be included in a single partition. 
  1819.  
  1820.  pragma Source_Reference 
  1821.  
  1822.            Syntax: 
  1823.  
  1824.                                               pragma Source_Reference (INTEGER_LITERAL,
  1825.                                                            STRING_LITERAL);
  1826.  
  1827.              This pragma must appear as the first line of a source file. 
  1828.              integer_literal is the logical line number of the line following 
  1829.              the pragma line (for use in error messages and debugging 
  1830.              information). string_literal is a static string constant that 
  1831.              specifies the file name to be used in error messages and debugging 
  1832.              information. This is most notably used for the output of gnatchop 
  1833.              with the '-r' switch, to make sure that the original unchopped 
  1834.              source file is the one referred to. 
  1835.  
  1836.              The second argument must be a string literal, it cannot be a 
  1837.              static string expression other than a string literal. This is 
  1838.              because its value is needed for error messages issued by all 
  1839.              phases of the compiler. 
  1840.  
  1841.  pragma Stream_Convert 
  1842.  
  1843.            Syntax: 
  1844.  
  1845.                                               pragma Stream_Convert (
  1846.                                                [Entity =>] type_LOCAL_NAME,
  1847.                                                [Read  =>] function_NAME,
  1848.                                                [Write  =>] function NAME);
  1849.  
  1850.              This pragma provides an efficient way of providing stream 
  1851.              functions for types defined in packages. Not only is it simpler to 
  1852.              use than declaring the necessary functions with attribute 
  1853.              representation clauses, but more significantly, it allows the 
  1854.              declaration to made in such a way that the stream packages are not 
  1855.              loaded unless they are needed. The use of the Stream_Convert 
  1856.              pragma adds no overhead at all, unless the stream attributes are 
  1857.              actually used on the designated type. 
  1858.  
  1859.              The first argument specifies the type for which stream functions 
  1860.              are provided. The second parameter provides a function used to 
  1861.              read values of this type. It must name a function whose argument 
  1862.              type may be any subtype, and whose returned type must be the type 
  1863.              given as the first argument to the pragma. 
  1864.  
  1865.              The meaning of the Read parameter is that if a stream attribute 
  1866.              directly or indirectly specifies reading of the type given as the 
  1867.              first parameter, then a value of the type given as the argument to 
  1868.              the Read function is read from the stream, and then the Read 
  1869.              function is used to convert this to the required target type. 
  1870.  
  1871.              Similarly the Write parameter specifies how to treat write 
  1872.              attributes that directly or indirectly apply to the type given as 
  1873.              the first parameter. It must have an input parameter of the type 
  1874.              specified by the first parameter, and the return type must be the 
  1875.              same as the input type of the Read function. The effect is to 
  1876.              first call the Write function to convert to the given stream type, 
  1877.              and then write the result type to the stream. 
  1878.  
  1879.              The Read and Write functions must not be overloaded subprograms. 
  1880.              If necessary renamings can be supplied to meet this requirement. 
  1881.              The usage of this attribute is best illustrated by a simple 
  1882.              example, taken from the GNAT implementation of package 
  1883.              Ada.Strings.Unbounded: 
  1884.  
  1885.                                               function To_Unbounded (S : String)
  1886.                                                     return Unbounded_String
  1887.                                                renames To_Unbounded_String;
  1888.                                               pragma Stream_Convert
  1889.                                                (Unbounded_String, To_Unbounded, To_String);
  1890.  
  1891.              The specifications of the referenced functions, as given in the 
  1892.              Ada 95 Reference Manual are: 
  1893.  
  1894.                                               function To_Unbounded_String (Source : String)
  1895.                                                return Unbounded_String;
  1896.                                               function To_String (Source : Unbounded_String)
  1897.                                                return String;
  1898.  
  1899.              The effect is that if the value of an unbounded string is written 
  1900.              to a stream, then the representation of the item in the stream is 
  1901.              in the same format used for Standard.String, and this same 
  1902.              representation is expected when a value of this type is read from 
  1903.              the stream. 
  1904.  
  1905.  pragma Style_Checks 
  1906.  
  1907.            Syntax: 
  1908.  
  1909.                                               pragma Style_Checks (string_LITERAL | ALL_CHECKS |
  1910.                                                          On | Off [, LOCAL_NAME]);
  1911.  
  1912.              This pragma is used in conjunction with compiler switches to 
  1913.              control the built in style checking provided by GNAT. The compiler 
  1914.              switches, if set provide an initial setting for the switches, and 
  1915.              this pragma may be used to modify these settings, or the settings 
  1916.              may be provided entirely by the use of the pragma. This pragma can 
  1917.              be used anywhere that a pragma is legal, including use as a 
  1918.              configuration pragma (including use in the 'gnat.adc' file). 
  1919.  
  1920.              The form with a string literal specifies which style options are 
  1921.              to be activated. These are additive, so they apply in addition to 
  1922.              any previously set style check options. The codes for the options 
  1923.              are the same as those used in the -gnaty switch on the gcc or 
  1924.              gnatmake line. For example the following two methods can be used 
  1925.              to enable layout checking: 
  1926.  
  1927.                                               pragma Style_Checks ("l");
  1928.                                               gcc -c -gnatyl ┬╖┬╖┬╖
  1929.  
  1930.              The form ALL_CHECKS activates all checks (its use is equivalent to 
  1931.              the use of the gnaty switch with no options. See GNAT User's Guide 
  1932.              for details. 
  1933.  
  1934.              The forms with Off and On can be used to temporarily disable style 
  1935.              checks as shown in the following example: 
  1936.  
  1937.                                               pragma Style_Checks ("k"); -- requires keywords in lower case
  1938.                                               pragma Style_Checks (Off); -- turn off style checks
  1939.                                               NULL;            -- this will not generate an error message
  1940.                                               pragma Style_Checks (On);  -- turn style checks back on
  1941.                                               NULL;            -- this will generate an error message
  1942.  
  1943.              Finally the two argument form is allowed only if the first 
  1944.              argument is On or Off. The effect is to turn of semantic style 
  1945.              checks for the specified entity, as shown in the following 
  1946.              example: 
  1947.  
  1948.                                               pragma Style_Checks ("r"); -- require consistency of identifier casing
  1949.                                               Arg : Integer;
  1950.                                               Rf1 : Integer := ARG;    -- incrrect, wrong case
  1951.                                               pragma Style_Checks (Off, Arg);
  1952.                                               Rf2 : Integer := ARG;    -- OK, no error
  1953.  
  1954.  pragma Subtitle 
  1955.  
  1956.            Syntax: 
  1957.  
  1958.                                               pragma Subtitle ([Subtitle =>] STRING_LITERAL);
  1959.  
  1960.              This pragma is recognized for compatibility with other Ada 
  1961.              compilers but is ignored by GNAT. 
  1962.  
  1963.  pragma Suppress_All 
  1964.  
  1965.            Syntax: 
  1966.  
  1967.                                               pragma Suppress_All;
  1968.  
  1969.              This pragma can only appear immediately following a compilation 
  1970.              unit. The effect is to apply Suppress (All_Checks) to the unit 
  1971.              which it follows. This pragma is implemented for compatibility 
  1972.              with DEC Ada 83 usage. The use of pragma Suppress (All_Checks) as 
  1973.              a normal configuration pragma is the preferred usage in GNAT. 
  1974.  
  1975.  pragma Suppress_Initialization 
  1976.  
  1977.            Syntax: 
  1978.  
  1979.                                               pragma Suppress_Initialization ([Entity =>] type_Name);
  1980.  
  1981.              This pragma suppresses any implicit or explicit initialization 
  1982.              associated with the given type name for all variables of this 
  1983.              type. 
  1984.  
  1985.  pragma Task_Info 
  1986.  
  1987.            Syntax 
  1988.  
  1989.                                               pragma Task_Info (EXPRESSION);
  1990.  
  1991.              This pragma appears within a task definition (like pragma 
  1992.              Priority) and applies to the task in which it appears. The 
  1993.              argument must be of type System.Task_Info.Task_Info_Type. The 
  1994.              Task_Info pragma provides system dependent control over aspect of 
  1995.              tasking implementation, for example, the ability to map tasks to 
  1996.              specific processors. For details on the facilities available for 
  1997.              the version of GNAT that you are using, see the documentation in 
  1998.              the specification of package System.Task_Info in the runtime 
  1999.              library. 
  2000.  
  2001.  pragma Task_Storage 
  2002.            Syntax: 
  2003.  
  2004.                                               pragma Task_Storage
  2005.                                                [Task_Type =>] LOCAL_NAME,
  2006.                                                [Top_Guard =>] static_integer_EXPRESSION);
  2007.  
  2008.              This pragma specifies the length of the guard area for tasks.  The 
  2009.              guard area is an additional storage area allocated to a task.  A 
  2010.              value of zero means that either no guard area is created or a 
  2011.              minimal guard area is created, depending on the target. This 
  2012.              pragma can appear anywhere a Storage_Size attribute definition 
  2013.              clause is allowed for a task type. 
  2014.  
  2015.  pragma Time_Slice 
  2016.  
  2017.            Syntax: 
  2018.  
  2019.                                               pragma Time_Slice (static_duration_EXPRESSION);
  2020.  
  2021.              For implementations of GNAT on operating systems where it is 
  2022.              possible to supply a time slice value, this pragma may be used for 
  2023.              this purpose. It is ignored if it is used in a system that does 
  2024.              not allow this control, or if it appears in other than the main 
  2025.              program unit. Note that the effect of this pragma is identical to 
  2026.              the effect of the DEC Ada 83 pragma of the same name when 
  2027.              operating under OpenVMS systems. 
  2028.  
  2029.  pragma Title 
  2030.  
  2031.            Syntax: 
  2032.  
  2033.                                               pragma Title (TITLING_OPTION [, TITLING OPTION]);
  2034.                                               TITLING_OPTION ::=
  2035.                                                [Title   =>] STRING_LITERAL,
  2036.                                               | [Subtitle =>] STRING_LITERAL
  2037.  
  2038.              Syntax checked but otherwise ignored by GNAT. This is a listing 
  2039.              control pragma used in DEC Ada 83 implementations to provide a 
  2040.              title and/or subtitle for the program listing. The program listing 
  2041.              generated by GNAT does not have titles or subtitles. 
  2042.  
  2043.              Unlike other pragmas, the full flexibility of named notation is 
  2044.              allowed for this pragma, i.e. the parameters may be given in any 
  2045.              order if named notation is used, and named and positional notation 
  2046.              can be mixed following the normal rules for procedure calls in 
  2047.              Ada. 
  2048.  
  2049.  pragma Unchecked_Union 
  2050.  
  2051.            Syntax: 
  2052.  
  2053.                                               pragma Unchecked_Union (first_subtype_LOCAL_NAME)
  2054.  
  2055.              This pragma is used to declare that the specified type should be 
  2056.              represented in a manner equivalent to a C union type, and is 
  2057.              intended only for use in interfacing with C code that uses union 
  2058.              types. In Ada terms, the named type must obey the following rules: 
  2059.  
  2060.                1. It is a non-tagged non-limited record type. 
  2061.  
  2062.                2. It has a single discrete discriminant with a default value. 
  2063.  
  2064.                3. The component list consists of a single variant part. 
  2065.  
  2066.                4. Each variant has a component list with a single component. 
  2067.  
  2068.                5. No nested variants are allowed. 
  2069.  
  2070.                6. No component has an explicit default value. 
  2071.  
  2072.                7. No component has a non-static constraint. 
  2073.  
  2074.              In addition, given a type that meets the above requirements, the 
  2075.              following restrictions apply to its use throughout the program: 
  2076.  
  2077.                1. The discriminant name can be mentioned only in an aggregate. 
  2078.  
  2079.                2. No subtypes may be created of this type. 
  2080.  
  2081.                3. The type may not be constrained by giving a discriminant 
  2082.                   value. 
  2083.  
  2084.                4. The type cannot be passed as the actual for a generic formal 
  2085.                   with a discriminant. 
  2086.  
  2087.              Equality and inequality operations on unchecked_unions are not 
  2088.              available, since there is no discriminant to compare and the 
  2089.              compiler does not even know how many bits to compare. It is 
  2090.              implementation dependent whether this is detected at compile time 
  2091.              as an illegality or whether it is undetected and considered to be 
  2092.              an erroneous construct. In GNAT, a direct comparison is illegal, 
  2093.              but GNAT does not attempt to catch the composite case (where two 
  2094.              composites are compared that contain an unchecked union 
  2095.              component), so such comparisons are simply considered erroneous. 
  2096.  
  2097.              The layout of the resulting type corresponds exactly to a C union, 
  2098.              where each branch of the union corresponds to a single variant in 
  2099.              the Ada record. The semantics of the Ada program is not changed in 
  2100.              any way by the pragma, i.e. provided the above restrictions are 
  2101.              followed, and no erroneous incorrect references to fields or 
  2102.              erroneous comparisons occur, the semantics is exactly as described 
  2103.              by the Ada reference manual. Pragma Suppress (Discriminant_Check) 
  2104.              applies implicitly to the type and the default convention is C 
  2105.  
  2106.  pragma Unimplemented_Unit 
  2107.  
  2108.            Syntax: 
  2109.  
  2110.                                               pragma Unimplemented_Unit;
  2111.  
  2112.              If this pragma occurs in a unit that is processed by the compiler, 
  2113.              GNAT aborts with the message 'xxx not implemented', where xxx is 
  2114.              the name of the current compilation unit.  This pragma is intended 
  2115.              to allow the compiler to handle unimplemented library units in a 
  2116.              clean manner. 
  2117.  
  2118.              The abort only happens if code is being generated.  Thus you can 
  2119.              use specs of unimplemented packages in syntax or semantic checking 
  2120.              mode. 
  2121.  
  2122.  pragma Unreserve_All_Interrupts 
  2123.  
  2124.            Syntax: 
  2125.  
  2126.                                               pragma Unreserve_All_Interrupts;
  2127.  
  2128.              Normally certain interrupts are reserved to the implementation. 
  2129.              Any attempt to attach an interrupt causes Program_Error to be 
  2130.              raised, as described in RM C.3.2(22). A typical example is the 
  2131.              SIGINT interrupt used in many systems for an Ctrl-C interrupt. 
  2132.              Normally this interrupt is reserved to the implementation, so that 
  2133.              Ctrl-C can be used to interrupt execution. 
  2134.  
  2135.              If the pragma Unreserve_All_Interrupts appears anywhere in any 
  2136.              unit in a program, then all such interrupts are unreserved. This 
  2137.              allows the program to handle these interrupts, but disables their 
  2138.              standard functions. For example, if this pragma is used, then 
  2139.              pressing Ctrl-C will not automatically interrupt execution. 
  2140.              However, a program can then handle the SIGINT interrupt as it 
  2141.              chooses. 
  2142.  
  2143.              For a full list of the interrupts handled in a specific 
  2144.              implementation, see the source code for the specification of 
  2145.              Ada.Interrupts.Names in file a-intnam.ads. This is a target 
  2146.              dependent file that contains the list of interrupts recognized for 
  2147.              a given target. The documentation in this file also specifies what 
  2148.              interrupts are affected by the use of the Unreserve_All_Interrupts 
  2149.              pragma. 
  2150.  
  2151.  pragma Unsuppress 
  2152.  
  2153.            Syntax: 
  2154.  
  2155.                                               pragma Unsuppress (IDENTIFIER [, [On =>] NAME]);
  2156.  
  2157.              This pragma undoes the effect of a previous pragma Suppress. If 
  2158.              there is no corresponding pragma Suppress in effect, it has no 
  2159.              effect. The range of the effect is the same as for pragma 
  2160.              Suppress. The meaning of the arguments is identical to that used 
  2161.              in pragma Suppress. 
  2162.  
  2163.              One important application is to ensure that checks are on in cases 
  2164.              where code depends on the checks for its correct functioning, so 
  2165.              that the code will compile correctly even if the compiler switches 
  2166.              are set to suppress checks. 
  2167.  
  2168.  pragma Use_VADS_Size 
  2169.  
  2170.            Syntax: 
  2171.  
  2172.                                               pragma Use_VADS_Size;
  2173.  
  2174.              This is a configuration pragma. In a unit to which it applies, any 
  2175.              use of the 'Size attribute is automatically interpreted as a use 
  2176.              of the 'VADS_Size attribute. Note that this may result in 
  2177.              incorrect semantic processing of valid Ada 95 programs. This is 
  2178.              intended to aid in the handling of legacy code which depends on 
  2179.              the interpretation of Size as implemented in the VADS compiler. 
  2180.              See description of the VADS_Size attribute for further details. 
  2181.  
  2182.  pragma Volatile 
  2183.  
  2184.            Syntax: 
  2185.  
  2186.                                               pragma Volatile (local_NAME)
  2187.  
  2188.              This pragma is defined by the Ada 95 Reference Manual, and the 
  2189.              GNAT implementation is fully conformant with this definition. The 
  2190.              reason it is mentioned in this section is that a pragma of the 
  2191.              same name was supplied in some Ada 83 compilers, including DEC Ada 
  2192.              83. The Ada 95 implementation of pragma Volatile is upwards 
  2193.              compatible with the implementation in Dec Ada 83. 
  2194.  
  2195.  pragma Warnings 
  2196.  
  2197.            Syntax: 
  2198.  
  2199.                                               pragma Warnings (On | Off [, LOCAL_NAME]);
  2200.  
  2201.              Normally warnings are enabled, with the output being controlled by 
  2202.              the command line switch. Warnings (Off) turns off generation of 
  2203.              warnings until a Warnings (On) is encountered or the end of the 
  2204.              current unit. If generation of warnings is turned off using this 
  2205.              pragma, then no warning messages are output, regardless of the 
  2206.              setting of the command line switches. 
  2207.  
  2208.              The form with a single argument is a configuration pragma. 
  2209.  
  2210.              If the local_name parameter is present, warnings are suppressed 
  2211.              for the specified entity. This suppression is effective from the 
  2212.              point where it occurs till the end of the extended scope of the 
  2213.              variable (similar to the scope of Suppress). 
  2214.  
  2215.  pragma Weak_External 
  2216.  
  2217.            Syntax: 
  2218.  
  2219.                                               pragma Weak_External ([Entity =>] LOCAL_NAME);
  2220.  
  2221.              This pragma specifies that the given entity should be marked as a 
  2222.              weak external (one that does not have to be resolved) for the 
  2223.              linker. For further details, consult the GCC manual. 
  2224.  
  2225.  
  2226. ΓòÉΓòÉΓòÉ 5. Implementation Defined Attributes ΓòÉΓòÉΓòÉ
  2227.  
  2228.  Ada 95 defines (throughout the Ada 95 reference manual, summarized in annex 
  2229.  K), a set of attributes that provide useful additional functionality in all 
  2230.  areas of the language. These language defined attributes are implemented in 
  2231.  GNAT and work as described in the Ada 95 Reference Manual. 
  2232.  
  2233.  In addition, Ada 95 allows implementations to define additional attributes 
  2234.  whose meaning is defined by the implementation. GNAT provides a number of 
  2235.  these implementation-dependent attributes which can be used to extend and 
  2236.  enhance the functionality of the compiler. This section of the GNAT reference 
  2237.  manual describes these additional attributes. 
  2238.  
  2239.  Note that any program using these attributes may not be portable to other 
  2240.  compilers (although GNAT implements this set of attributes on all platforms). 
  2241.  Therefore if portability to other compilers is an important consideration, you 
  2242.  should minimize the use of these attributes. 
  2243.  
  2244.  Abort_Signal 
  2245.  
  2246.            Standard'Abort_Signal (Standard is the only allowed prefix) provides 
  2247.            the entity for the special exception used to signal task abort or 
  2248.            asynchronous transfer of control. Normally this attribute should 
  2249.            only be used in the tasking runtime (it is highly peculiar, and 
  2250.            completely outside the normal semantics of Ada, for a user program 
  2251.            to intercept the abort exception). 
  2252.  
  2253.  Address_Size 
  2254.  
  2255.            Standard'Address_Size (Standard is the only allowed prefix) is a 
  2256.            static constant giving the number of bits in an Address. It is used 
  2257.            primarily for constructing the definition of Memory_Size in package 
  2258.            Standard, but may be freely used in user programs. 
  2259.  
  2260.  Asm_Input 
  2261.  
  2262.            The Asm_Input attribute denotes a function that takes two 
  2263.            parameters.  The first is a string, the second is an expression of 
  2264.            the type designated by the prefix. The first (string) argument is 
  2265.            required to be a static expression, and is the constraint for the 
  2266.            parameter, (e.g. what kind of register is required). The second 
  2267.            argument is the value to be used as the input argument. The possible 
  2268.            values for the constant are the same as those used in the RTL, and 
  2269.            are dependent on the configuration file used to built the GCC back 
  2270.            end. Machine Code Insertions 
  2271.  
  2272.  Asm_Output 
  2273.  
  2274.            The Asm_Output attribute denotes a function that takes two 
  2275.            parameters.  The first is a string, the second is the name of a 
  2276.            variable of the type designated by the attribute prefix. The first 
  2277.            (string) argument is required to be a static expression and 
  2278.            designates the constraint for the parameter (e.g. what kind of 
  2279.            register is required). The second argument is the variable to be 
  2280.            updated with the result. The possible values for constraint are the 
  2281.            same as those used in the RTL, and are dependent on the 
  2282.            configuration file used to build the GCC back end.  If there are no 
  2283.            output operands, then this argument may either be omitted, or 
  2284.            explicitly given as No_Output_Operands. Machine Code Insertions 
  2285.  
  2286.  AST_Entry 
  2287.  
  2288.            This attribute is implemented only in OpenVMS versions of GNAT. 
  2289.            Applied to the name of an entry, it yields a value of the predefined 
  2290.            type AST_Handler (declared in the predefined package System, as 
  2291.            extended by the use of pragma Extend_System (Aux_DEC)). This value 
  2292.            enables the given entry to be called when an AST occurs. For further 
  2293.            details, refer to the DEC Ada Language Reference Manual, section 
  2294.            9.12a. 
  2295.  
  2296.  Bit 
  2297.            obj'Bit, where obj is any object, yields the bit offset within the 
  2298.            storage unit (byte) that contains the first bit of storage allocated 
  2299.            for the object. The value of this attribute is of the type 
  2300.            Universal_Integer, and is always a non-negative number not exceeding 
  2301.            the value of System.Storage_Unit. 
  2302.  
  2303.            For an object that is a variable or a constant allocated in a 
  2304.            register, the value is zero. (The use of this attribute does not 
  2305.            force the allocation of a variable to memory). 
  2306.  
  2307.            For an object that is a formal parameter, this attribute applies to 
  2308.            either the matching actual parameter or to a copy of the matching 
  2309.            actual parameter. 
  2310.  
  2311.            For an access object the value is zero. Note that obj.all'Bit is 
  2312.            subject to an Access_Check for the designated object. Similarly for 
  2313.            a record component X.C'Bit is subject to a discriminant check and 
  2314.            X(I).Bit and X(I1┬╖┬╖I2)'Bit are subject to index checks. 
  2315.  
  2316.            This attribute is designed to be compatible with the DEC Ada 83 
  2317.            definition and implementation of the Bit attribute. 
  2318.  
  2319.  Bit_Position 
  2320.  
  2321.            R.C'Bit, where R is a record object and C is one of the fields of 
  2322.            the record type, yields the bit offset within the record contains 
  2323.            the first bit of storage allocated for the object. The value of this 
  2324.            attribute is of the type Universal_Integer. The value depends only 
  2325.            on the field C and is independent of the alignment of the containing 
  2326.            record R. 
  2327.  
  2328.  Code_Address 
  2329.  
  2330.            The 'Address attribute may be applied to subprograms in Ada 95, but 
  2331.            the intended effect from the Ada 95 reference manual seems to be to 
  2332.            provide an address value which can be used to call the subprogram by 
  2333.            means of an address clause as in the following example: 
  2334.  
  2335.                       procedure K is ┬╖┬╖┬╖
  2336.                       procedure L;
  2337.                       for L'Address use K'Address;
  2338.                       pragma Import (Ada, L);
  2339.  
  2340.  A call to L is then expected to result in a call to K. In Ada 83, where there 
  2341.  were no access-to-subprogram values, this was a common work around for getting 
  2342.  the effect of an indirect call. GNAT implements the above use of Address and 
  2343.  the technique illustrated by the example code works correctly. 
  2344.  
  2345.  However, for some purposes, it is useful to have the address of the start of 
  2346.  the generated code for the subprogram. On some architectures, this is not 
  2347.  necessarily the same as the Address value described above. For example, the 
  2348.  Address value may reference a subprogram descriptor rather than the subprogram 
  2349.  itself. 
  2350.  
  2351.  The 'Code_Address attribute, which can only be applied to subprogram entities, 
  2352.  always returns the address of the start of the generated code of the specified 
  2353.  subprogram, which may or may not be the same value as is returned by the 
  2354.  corresponding 'Address attribute. 
  2355.  
  2356.  Default_Bit_Order 
  2357.  
  2358.            Standard'Default_Bit_Order (Standard is the only permissible 
  2359.            prefix), provides the value System.Default_Bit_Order as a Pos value 
  2360.            (0 for High_Order_First, 1 for Low_Order_First). This is used to 
  2361.            construct the definition of Default_Bit_Order in package System. 
  2362.  
  2363.  Elaborated 
  2364.  
  2365.            The prefix of the 'Elaborated attribute must be a unit name. The 
  2366.            value is a Boolean which indicates whether or not the given unit has 
  2367.            been elaborated. This attribute is primarily intended for internal 
  2368.            use by the generated code for dynamic elaboration checking, but it 
  2369.            can also be used in user programs. The value will always be True 
  2370.            once elaboration of all units has been completed. 
  2371.  
  2372.  Elab_Body 
  2373.  
  2374.            This attribute can only be applied to a program unit name. It 
  2375.            returns the entity for the corresponding elaboration procedure for 
  2376.            elaborating the body of the referenced unit. This is used in the 
  2377.            main generated elaboration procedure by the binder and is not 
  2378.            normally used in any other context.  However, there may be 
  2379.            specialized situations in which it is useful to be able to call this 
  2380.            elaboration procedure from Ada code, e.g. if it is necessary to do 
  2381.            selective re-elaboration to fix some error. 
  2382.  
  2383.  Elab_Spec 
  2384.  
  2385.            This attribute can only be applied to a program unit name. It 
  2386.            returns the entity for the corresponding elaboration procedure for 
  2387.            elaborating the specification of the referenced unit. This is used 
  2388.            in the main generated elaboration procedure by the binder and is not 
  2389.            normally used in any other context.  However, there may be 
  2390.            specialized situations in which it is useful to be able to call this 
  2391.            elaboration procedure from Ada code, e.g. if it is necessary to do 
  2392.            selective re-elaboration to fix some error. 
  2393.  
  2394.  Emax 
  2395.  
  2396.            The Emax attribute is provided for compatibility with Ada 83. See 
  2397.            the Ada 83 reference manual for an exact description of the 
  2398.            semantics of this attribute. 
  2399.  
  2400.  Enum_Rep 
  2401.  
  2402.            For every enumeration subtype S, S'Enum_Rep denotes a function with 
  2403.            the following specification: 
  2404.  
  2405.                       function S'Enum_Rep (Arg : S'Base)
  2406.                        return Universal_Integer;
  2407.  
  2408.  It is also allowable to apply Enum_Rep directly to an object of an enumeration 
  2409.  type or to a non-overloaded enumeration literal. In this case S'Enum_Rep is 
  2410.  equivalent to typ'Enum_Rep(S) where typ is the type of the enumeration literal 
  2411.  or object. 
  2412.  
  2413.  The function returns the representation value for the given enumeration value. 
  2414.  This will be equal to value of the Pos attribute in the absence of an 
  2415.  enumeration representation clause. This is a static attribute (i.e. the result 
  2416.  is static if the argument is static). 
  2417.  
  2418.  S'Enum_Rep can also be used with integer types and objects, in which case it 
  2419.  simply returns the integer value. The reason for this is to allow it to be 
  2420.  used for (<>) discrete formal arguments in a generic unit that can be 
  2421.  instantiated with either enumeration types or integer types. 
  2422.  
  2423.  Epsilon 
  2424.  
  2425.            The Epsilon attribute is provided for compatibility with Ada 83. See 
  2426.            the Ada 83 reference manual for an exact description of the 
  2427.            semantics of this attribute. 
  2428.  
  2429.  Fixed_Value 
  2430.  
  2431.            For every fixed-point type S, S'Fixed_Value denotes a function with 
  2432.            the following specification: 
  2433.  
  2434.                       function S'Fixed_Value (Arg : Universal_Integer)
  2435.                        return S;
  2436.  
  2437.  The value returned is the fixed-point value V such that 
  2438.  
  2439.                       V = Arg * S'Small
  2440.  
  2441.  The effect is thus equivalent to first converting the argument to the integer 
  2442.  type used to represent S, and then doing an unchecked conversion to the 
  2443.  fixed-point type. This attribute is primarily intended for use in 
  2444.  implementation of the input-output functions for fixed-point values. 
  2445.  
  2446.  Has_Discriminants 
  2447.  
  2448.            The prefix of the Has_Discriminants attribute is a type. The result 
  2449.            is a Boolean value which is True if the type has discriminants, and 
  2450.            False otherwise. The intended use of this attribute is in 
  2451.            conjunction with generic definitions. If the attribute is applied to 
  2452.            a generic private type, it indicates whether or not the 
  2453.            corresponding actual type has discriminants. 
  2454.  
  2455.  Img 
  2456.  
  2457.            The Img attribute differs from Image in that it may be applied to 
  2458.            objects as well as types, in which case it gives the Image for the 
  2459.            subtype of the object. This is convenient for debugging: 
  2460.  
  2461.                       Put_Line ("X = " & X'Img);
  2462.  
  2463.  has the same meaning as the more verbose: 
  2464.  
  2465.                       Put_Line ("X = " & type'Image (X));
  2466.  
  2467.  where type is the subtype of the object X. 
  2468.  
  2469.  Integer_Value 
  2470.  
  2471.            For every integer type S, S'Integer_Value denotes a function with 
  2472.            the following specification: 
  2473.  
  2474.                       function S'Integer_Value (Arg : Universal_Fixed)
  2475.                        return S;
  2476.  
  2477.  The value returned is the integer value V, such that 
  2478.  
  2479.                       Arg = V * type'Small
  2480.  
  2481.  The effect is thus equivalent to first doing an unchecked convert from the 
  2482.  fixed-point type to its corresponding implementation type, and then converting 
  2483.  the result to the target integer type. This attribute is primarily intended 
  2484.  for use in implementation of the standard input-output functions for 
  2485.  fixed-point values. 
  2486.  
  2487.  Large 
  2488.  
  2489.            The Large attribute is provided for compatibility with Ada 83. See 
  2490.            the Ada 83 reference manual for an exact description of the 
  2491.            semantics of this attribute. 
  2492.  
  2493.  Machine_Size 
  2494.  
  2495.            This attribute is identical to the Object_Size attribute. It is 
  2496.            provided for compatibility with the DEC Ada 83 attribute of this 
  2497.            name. 
  2498.  
  2499.  Mantissa 
  2500.  
  2501.            The Mantissa attribute is provided for compatibility with Ada 83. 
  2502.            See the Ada 83 reference manual for an exact description of the 
  2503.            semantics of this attribute. 
  2504.  
  2505.  Max_Interrupt_Priority 
  2506.  
  2507.            Standard'Max_Interrupt_Priority (Standard is the only permissible 
  2508.            prefix), provides the value System.Max_Interrupt_Priority and is 
  2509.            intended primarily for constructing this definition in package 
  2510.            System. 
  2511.  
  2512.  Max_Priority 
  2513.  
  2514.            Standard'Max_Priority (Standard is the only permissible prefix) 
  2515.            provides the value System.Max_Priority and is intended primarily for 
  2516.            constructing this definition in package System. 
  2517.  
  2518.  Maximum_Alignment 
  2519.  
  2520.            Standard'Maximum_Alignment (Standard is the only permissible prefix) 
  2521.            provides the maximum useful alignment value for the target. This is 
  2522.            a static value that can be used to specify the alignment for an 
  2523.            object, guaranteeing that it is properly aligned in all cases. This 
  2524.            is useful when an external object is imported and its alignment 
  2525.            requirements are unknown. 
  2526.  
  2527.  Mechanism_Code 
  2528.  
  2529.            function'Mechanism_Code yields an integer code for the mechanism 
  2530.            used for the result of function, and subprogram'Mechanism_Code (n) 
  2531.            yields the mechanism used for formal parameter number n (a static 
  2532.            integer value with 1 meaning the first parameter) of subprogram. The 
  2533.            code returned is: 
  2534.  
  2535.              1 
  2536.                          by copy (value) 
  2537.  
  2538.              2 
  2539.                          by reference 
  2540.  
  2541.              3 
  2542.                          by descriptor (default descriptor class) 
  2543.  
  2544.              4 
  2545.                          by descriptor (UBS: unaligned bit string) 
  2546.  
  2547.              5 
  2548.                          by descriptor (UBSB: aligned bit string with arbitrary 
  2549.                          bounds) 
  2550.  
  2551.              6 
  2552.                          by descriptor (UBA: unaligned bit array) 
  2553.  
  2554.              7 
  2555.                          by descriptor (S: string, also scalar access type 
  2556.                          parameter) 
  2557.  
  2558.              8 
  2559.                          by descriptor (SB: string with arbitrary bounds) 
  2560.  
  2561.              9 
  2562.                          by descriptor (A: contiguous array) 
  2563.  
  2564.              10 
  2565.                          by descriptor ( NCA: non-contiguous array) 
  2566.  
  2567.              Values from 3-10 are only relevant to Digital OpenVMS 
  2568.              implementations. 
  2569.  
  2570.  Null_Parameter 
  2571.  
  2572.            A reference T'Null_Parameter denotes an imaginary object of type or 
  2573.            subtype T allocated at machine address zero. The attribute is 
  2574.            allowed only as the default expression of a formal parameter, or as 
  2575.            an actual expression of a subprogram call. In either case, the 
  2576.            subprogram must be imported. 
  2577.  
  2578.            The identity of the object is represented by the address zero in the 
  2579.            argument list, independent of the passing mechanism (explicit or 
  2580.            default). 
  2581.  
  2582.            This capability is needed to specify that a zero address should be 
  2583.            passed for a record or other composite object passed by reference. 
  2584.            There is no way of indicating this without the Null_Parameter 
  2585.            attribute. 
  2586.  
  2587.  Object_Size 
  2588.  
  2589.            The size of an object is not necessarily the same as the size of the 
  2590.            type of an object. This is because by default object sizes are 
  2591.            increased to be a multiple of the alignment of the object. For 
  2592.            example, Natural'Size is 31, but by default objects of type Natural 
  2593.            will have a size of 32 bits. Similarly, a record containing an 
  2594.            integer and a character: 
  2595.  
  2596.                                               type Rec is record
  2597.                                                 I : Integer;
  2598.                                                 C : Character;
  2599.                                               end record;
  2600.  
  2601.              will have a size of 40 (that is Rec'Size will be 40. The alignment 
  2602.              will be 4, because of the integer field, and so the default size 
  2603.              of record objects for this type will be 64 (8 bytes). 
  2604.  
  2605.              The type'Object_Size attribute has been added to GNAT to allow the 
  2606.              default object size of a type to be easily determined. For 
  2607.              example, Natural'Object_Size is 32, and Rec'Object_Size (for the 
  2608.              record type in the above example) will be 64. Note also that, 
  2609.              unlike the situation with the Size attribute as defined in the Ada 
  2610.              RM, the Object_Size attribute can be specified individually for 
  2611.              different subtypes. For example: 
  2612.  
  2613.                                               type R is new Integer;
  2614.                                               subtype R1 is R range 1 ┬╖┬╖ 10;
  2615.                                               subtype R2 is R range 1 ┬╖┬╖ 10;
  2616.                                               for R2'Object_Size use 8;
  2617.  
  2618.              In this example, R'Object_Size and R1'Object_Size are both 32 
  2619.              since the default object size for a subtype is the same as the 
  2620.              object size for the the parent subtype. This means that objects of 
  2621.              type R or R1 will by default be 32 bits (four bytes). But objects 
  2622.              of type R2 will be only 8 bits (one byte), since R2'Object_Size 
  2623.              has been set to 8. 
  2624.  
  2625.  Passed_By_Reference 
  2626.  
  2627.            type'Passed_By_Reference for any subtype type returns a value of 
  2628.            type Boolean value that is True if the type is normally passed by 
  2629.            reference and False if the type is normally passed by copy in calls. 
  2630.            For scalar types, the result is always False and is static. For 
  2631.            non-scalar types, the result is non-static. 
  2632.  
  2633.  Range_Length 
  2634.  
  2635.            type'Range_Length for any discrete type type yields the number of 
  2636.            values represented by the subtype (zero for a null range). The 
  2637.            result is static for static subtypes. Range_Length applied to the 
  2638.            index subtype of a one dimensional array always gives the same 
  2639.            result as Range applied to the array itself. 
  2640.  
  2641.  Safe_Emax 
  2642.  
  2643.            The Safe_Emax attribute is provided for compatibility with Ada 83. 
  2644.            See the Ada 83 reference manual for an exact description of the 
  2645.            semantics of this attribute. 
  2646.  
  2647.  Safe_Large 
  2648.  
  2649.            The Safe_Large attribute is provided for compatibility with Ada 83. 
  2650.            See the Ada 83 reference manual for an exact description of the 
  2651.            semantics of this attribute. 
  2652.  
  2653.  Safe_Large 
  2654.  
  2655.            The Safe_Large attribute is provided for compatibility with Ada 83. 
  2656.            See the Ada 83 reference manual for an exact description of the 
  2657.            semantics of this attribute. 
  2658.  
  2659.  Small 
  2660.  
  2661.            The Small attribute is defined in Ada 95 only for fixed-point types. 
  2662.            GNAT also allows this attribute to be applied to floating-point 
  2663.            types for compatibility with Ada 83. See the Ada 83 reference manual 
  2664.            for an exact description of the semantics of this attribute when 
  2665.            applied to floating-point types. 
  2666.  
  2667.  Storage_Unit 
  2668.  
  2669.            Standard'Storage_Unit (Standard is the only permissible prefix) 
  2670.            provides the value System.Storage_Unit and is intended primarily for 
  2671.            constructing this definition in package System. 
  2672.  
  2673.  Tick 
  2674.  
  2675.            Standard'Tick (Standard is the only permissible prefix) provides the 
  2676.            value of System.Tick and is intended primarily for constructing this 
  2677.            definition in package System. 
  2678.  
  2679.  To_Address 
  2680.  
  2681.            The System'To_Address (System is the only permissible prefix) 
  2682.            denotes a function identical to System.Storage_Elements.To_Address 
  2683.            except that it is a static attribute. This means that if its 
  2684.            argument is a static expression, then the result of the attribute is 
  2685.            a static expression. The result is that such an expression can be 
  2686.            used in contexts (e.g. preelaborable packages) which require a 
  2687.            static expression and where the function call could not be used 
  2688.            (since the function call is always non-static, even if its argument 
  2689.            is static). 
  2690.  
  2691.  Type_Class 
  2692.  
  2693.            type'Type_Class for any type or subtype type yields the value of the 
  2694.            type class for the full type of type. If type is a generic formal 
  2695.            type, the value is the value for the corresponding actual subtype. 
  2696.            The value of this attribute is of type System.Aux_DEC.Type_Class, 
  2697.            which has the following definition: 
  2698.  
  2699.                                                type Type_Class is
  2700.                                                 (Type_Class_Enumeration,
  2701.                                                  Type_Class_Integer,
  2702.                                                  Type_Class_Fixed_Point,
  2703.                                                  Type_Class_Floating_Point,
  2704.                                                  Type_Class_Array,
  2705.                                                  Type_Class_Record,
  2706.                                                  Type_Class_Access,
  2707.                                                  Type_Class_Task,
  2708.                                                  Type_Class_Address);
  2709.  
  2710.              Protected types yield the value Type_Class_Task, which thus 
  2711.              applies to all concurrent types. This attribute is designed to be 
  2712.              compatible with the DEC Ada 83 attribute of the same name. 
  2713.  
  2714.  UET_Address 
  2715.  
  2716.            The UET_Address attribute can only be used for a prefix which 
  2717.            denotes a library package. It yields the address of the unit 
  2718.            exception table when zero cost exception handling is used. This 
  2719.            attribute is intended only for use within the GNAT implementation. 
  2720.            See the unit Ada.Exceptions in files 'a-except.ads,a-except.adb' for 
  2721.            details on how this attribute is used in the implementation. 
  2722.  
  2723.  Universal_Literal_String 
  2724.  
  2725.            The prefix of Universal_Literal_String must be a named number. The 
  2726.            static result is the string consisting of the characters of the 
  2727.            number as defined in the original source. This allows the user 
  2728.            program to access the actual text of named numbers without 
  2729.            intermediate conversions and without the need to enclose the strings 
  2730.            in quotes (which would preclude their use as numbers). This is used 
  2731.            internally for the construction of values of the floating-point 
  2732.            attributes from the file 'ttypef.ads', but may also be used by user 
  2733.            programs. 
  2734.  
  2735.  Unrestricted_Access 
  2736.  
  2737.            The Unrestricted_Access attribute is similar to Access except that 
  2738.            all accessibility and aliased view checks are omitted. This is a 
  2739.            user-beware attribute.  It is similar to Address, for which it is a 
  2740.            desirable replacement where the value desired is an access type. In 
  2741.            other words, its effect is identical to first applying the Address 
  2742.            attribute and then doing an unchecked conversion to a desired access 
  2743.            type. In GNAT, but not necessarily in other implementations, the use 
  2744.            of static chains for inner level subprograms means that 
  2745.            Unrestricted_Access applied to a subprogram yields a value that can 
  2746.            be called as long as the subprogram is in scope (normal Ada 95 
  2747.            accessibility rules restrict this usage). 
  2748.  
  2749.  VADS_Size 
  2750.  
  2751.            The 'VADS_Size attribute is intended to make it easier to port 
  2752.            legacy code which relies on the semantics of 'Size as implemented by 
  2753.            the VADS Ada 83 compiler. GNAT makes a best effort at duplicating 
  2754.            the same semantic interpretation. In particular, 'VADS_Size applied 
  2755.            to a predefined or other primitive type with no Size clause yields 
  2756.            the Object_Size (for example, Natural'Size is 32 rather than 31 on 
  2757.            typical machines). In addition 'VADS_Size applied to an object gives 
  2758.            the result that would be obtained by applying the attribute to the 
  2759.            corresponding type. 
  2760.  
  2761.  Value_Size 
  2762.            type'Value_Size is the number of bits required to represent a value 
  2763.            of the given subtype. It is the same as type'Size, but, unlike Size, 
  2764.            may be set for non-first subtypes. 
  2765.  
  2766.  Word_Size 
  2767.            Standard'Word_Size (Standard is the only permissible prefix) 
  2768.            provides the value System.Word_Size and is intended primarily for 
  2769.            constructing this definition in package System. 
  2770.  
  2771.  
  2772. ΓòÉΓòÉΓòÉ 6. Implementation Advice ΓòÉΓòÉΓòÉ
  2773.  
  2774.  The main text of the Ada 95 Reference Manual describes the required behavior 
  2775.  of all Ada 95 compilers, and the GNAT compiler conforms to these requirements. 
  2776.  
  2777.  In addition, there are sections throughout the Ada 95 reference manual headed 
  2778.  by the phrase ``implementation advice''. These sections are not normative, 
  2779.  i.e. they do not specify requirements that all compilers must follow. Rather 
  2780.  they provide advice on generally desirable behavior. You may wonder why they 
  2781.  are not requirements. The most typical answer is that they describe behavior 
  2782.  that seems generally desirable, but cannot be provided on all systems, or 
  2783.  which may be undesirable on some systems. 
  2784.  
  2785.  As far as practical, GNAT follows the implementation advice sections in the 
  2786.  Ada 95 Reference Manual. This chapter contains a table giving the reference 
  2787.  manual section number, paragraph number and several keywords for each advice. 
  2788.  Each entry consists of the text of the advice followed by the GNAT 
  2789.  interpretation of this advice. Most often, this simply says ``followed'', 
  2790.  which means that GNAT follows the advice. However, in a number of cases, GNAT 
  2791.  deliberately deviates from this advice, in which case the text describes what 
  2792.  GNAT does and why. 
  2793.  
  2794.  1.1.3(20): Error Detection 
  2795.  
  2796.            If an implementation detects the use of an unsupported Specialized 
  2797.            Needs Annex feature at run time, it should raise Program_Error if 
  2798.            feasible. Not relevant. All specialized needs annex features are 
  2799.            either supported, or diagnosed at compile time. 
  2800.  
  2801.  1.1.3(31): Child Units 
  2802.  
  2803.            If an implementation wishes to provide implementation-defined 
  2804.            extensions to the functionality of a language-defined library unit, 
  2805.            it should normally do so by adding children to the library unit. 
  2806.            Followed. 
  2807.  
  2808.  1.1.5(12): Bounded Errors 
  2809.  
  2810.            If an implementation detects a bounded error or erroneous execution, 
  2811.            it should raise Program_Error. Followed in all cases in which the 
  2812.            implementation detects a bounded error or erroneous execution. Not 
  2813.            all such situations are detected at runtime. 
  2814.  
  2815.  2.8(16): Pragmas 
  2816.  
  2817.            Normally, implementation-defined pragmas should have no semantic 
  2818.            effect for error-free programs; that is, if the 
  2819.            implementation-defined pragmas are removed from a working program, 
  2820.            the program should still be legal, and should still have the same 
  2821.            semantics. The following implementation defined pragmas are 
  2822.            exceptions to this rule: 
  2823.  
  2824.              Abort_Defer 
  2825.                          Affects semantics 
  2826.  
  2827.              Ada_83 
  2828.                          Affects legality 
  2829.  
  2830.              Assert 
  2831.                          Affects semantics 
  2832.  
  2833.              CPP_Class 
  2834.                          Affects semantics 
  2835.  
  2836.              CPP_Constructor 
  2837.                          Affects semantics 
  2838.  
  2839.              CPP_Destructor 
  2840.                          Affects semantics 
  2841.  
  2842.              CPP_Virtual 
  2843.                          Affects semantics 
  2844.  
  2845.              CPP_Vtable 
  2846.                          Affects semantics 
  2847.  
  2848.              Debug 
  2849.                          Affects semantics 
  2850.  
  2851.              Interface_Name 
  2852.                          Affects semantics 
  2853.  
  2854.              Machine_Attribute 
  2855.                          Affects semantics 
  2856.  
  2857.              Unimplemented_Unit 
  2858.                          Affects legality 
  2859.  
  2860.              Unchecked_Union 
  2861.                          Affects semantics 
  2862.  
  2863.              In each of the above cases, it is essential to the purpose of the 
  2864.              pragma that this advice not be followed. For details see the 
  2865.              separate section on implementation defined pragmas. 
  2866.  
  2867.  2.8(17-19): Pragmas 
  2868.  
  2869.            Normally, an implementation should not define pragmas that can make 
  2870.            an illegal program legal, except as follows: 
  2871.            A pragma used to complete a declaration, such as a pragma Import; 
  2872.            A pragma used to configure the environment by adding, removing, or 
  2873.            replacing library_items. See response to paragraph 16 of this same 
  2874.            section. 
  2875.  
  2876.  3.5.2(5): Alternative Character Sets 
  2877.  
  2878.            If an implementation supports a mode with alternative 
  2879.            interpretations for Character and Wide_Character, the set of graphic 
  2880.            characters of Character should nevertheless remain a proper subset 
  2881.            of the set of graphic characters of Wide_Character. Any character 
  2882.            set ``localizations'' should be reflected in the results of the 
  2883.            subprograms defined in the language-defined package 
  2884.            Characters.Handling (see A.3) available in such a mode. In a mode 
  2885.            with an alternative interpretation of Character, the implementation 
  2886.            should also support a corresponding change in what is a legal 
  2887.            identifier_letter. Not all wide character modes follow this advice, 
  2888.            in particular the JIS and IEC modes reflect standard usage in Japan, 
  2889.            and in these encoding, the upper half of the Latin-1 set is not part 
  2890.            of the wide-character subset, since the most significant bit is used 
  2891.            for wide character encoding. However, this only applies to the 
  2892.            external forms. Internally there is no such restriction. 
  2893.  
  2894.  3.5.4(28): Integer Types 
  2895.  
  2896.            An implementation should support Long_Integer in addition to Integer 
  2897.            if the target machine supports 32-bit (or longer) arithmetic. No 
  2898.            other named integer subtypes are recommended for package Standard. 
  2899.            Instead, appropriate named integer subtypes should be provided in 
  2900.            the library package Interfaces (see B.2). Long_Integer is supported. 
  2901.            Other standard integer types are supported so this advice is not 
  2902.            fully followed. These types are supported for convenient interface 
  2903.            to C, and so that all hardware types of the machine are easily 
  2904.            available. 
  2905.  
  2906.  3.5.4(29): Integer Types 
  2907.  
  2908.            An implementation for a two's complement machine should support 
  2909.            modular types with a binary modulus up to System.Max_Int*2+2. An 
  2910.            implementation should support a non-binary modules up to 
  2911.            Integer'Last. Followed. 
  2912.  
  2913.  3.5.5(8): Enumeration Values 
  2914.  
  2915.            For the evaluation of a call on S'Pos for an enumeration subtype, if 
  2916.            the value of the operand does not correspond to the internal code 
  2917.            for any enumeration literal of its type (perhaps due to an 
  2918.            un-initialized variable), then the implementation should raise 
  2919.            Program_Error. This is particularly important for enumeration types 
  2920.            with noncontiguous internal codes specified by an 
  2921.            enumeration_representation_clause. Followed. 
  2922.  
  2923.  3.5.7(17): Float Types 
  2924.  
  2925.            An implementation should support Long_Float in addition to Float if 
  2926.            the target machine supports 11 or more digits of precision. No other 
  2927.            named floating point subtypes are recommended for package Standard. 
  2928.            Instead, appropriate named floating point subtypes should be 
  2929.            provided in the library package Interfaces (see B.2). Short_Float 
  2930.            and Long_Long_Float are also provided. The former provides improved 
  2931.            compatibility with other implementations supporting this type. The 
  2932.            latter corresponds to the highest precision floating-point type 
  2933.            supported by the hardware. On most machines, this will be the same 
  2934.            as Long_Float, but on some machines, it will correspond to the IEEE 
  2935.            extended form. The notable case is all ia32 (x86) implementations, 
  2936.            where Long_Long_Float corresponds to the 80-bit extended precision 
  2937.            format supported in hardware on this processor. Note that the 
  2938.            128-bit format on SPARC is not supported, since this is a software 
  2939.            rather than a hardware format. 
  2940.  
  2941.  3.6.2(11): Multidimensional Arrays 
  2942.  
  2943.            An implementation should normally represent multidimensional arrays 
  2944.            in row-major order, consistent with the notation used for 
  2945.            multidimensional array aggregates (see 4.3.3). However, if a pragma 
  2946.            Convention (Fortran, ┬╖┬╖┬╖) applies to a multidimensional array type, 
  2947.            then column-major order should be used instead (see B.5, 
  2948.            ``Interfacing with Fortran''). Followed. 
  2949.  
  2950.  9.6(30-31): Duration'Small 
  2951.  
  2952.            Whenever possible in an implementation, the value of Duration'Small 
  2953.            should be no greater than 100 microseconds. Followed. 
  2954.            (Duration'Small = 10**(-9)). 
  2955.  
  2956.            The time base for delay_relative_statements should be monotonic; it 
  2957.            need not be the same time base as used for Calendar.Clock. Followed. 
  2958.  
  2959.  10.2.1(12): Consistent Representation 
  2960.  
  2961.            In an implementation, a type declared in a pre-elaborated package 
  2962.            should have the same representation in every elaboration of a given 
  2963.            version of the package, whether the elaborations occur in distinct 
  2964.            executions of the same program, or in executions of distinct 
  2965.            programs or partitions that include the given version. Followed, 
  2966.            except in the case of tagged types. Tagged types involve implicit 
  2967.            pointers to a local copy of a dispatch table, and these pointers 
  2968.            have representations which thus depend on a particular elaboration 
  2969.            of the package. It is not easy to see how it would be possible to 
  2970.            follow this advice without severely impacting efficiency of 
  2971.            execution. 
  2972.  
  2973.  11.4.1(19): Exception Information 
  2974.  
  2975.            Exception_Message by default and Exception_Information should 
  2976.            produce information useful for debugging. Exception_Message should 
  2977.            be short, about one line. Exception_Information can be long. 
  2978.            Exception_Message should not include the Exception_Name. 
  2979.            Exception_Information should include both the Exception_Name and the 
  2980.            Exception_Message. Followed. For each exception that doesn't have a 
  2981.            specified Exception_Message, the compiler generates one containing 
  2982.            the location of the raise statement. This location has the form 
  2983.            "file:line", where file is the short file name (without path 
  2984.            information) and line is the line number in the file. Note that in 
  2985.            the case of the Zero Cost Exception mechanism, these messages become 
  2986.            redundant with the Exception_Information that contains a full 
  2987.            backtrace of the calling sequence, so they are disabled. To disable 
  2988.            explicitly the generation of the source location message, use the 
  2989.            Pragma Discard_Names. 
  2990.  
  2991.  11.5(28): Suppression of Checks 
  2992.  
  2993.            The implementation should minimize the code executed for checks that 
  2994.            have been suppressed. Followed. 
  2995.  
  2996.  13.1 (21-24): Representation Clauses 
  2997.  
  2998.            The recommended level of support for all representation items is 
  2999.            qualified as follows: 
  3000.            An implementation need not support representation items containing 
  3001.            non-static expressions, except that an implementation should support 
  3002.            a representation item for a given entity if each non-static 
  3003.            expression in the representation item is a name that statically 
  3004.            denotes a constant declared before the entity. Followed. GNAT does 
  3005.            not support non-static expressions in representation clauses unless 
  3006.            they are constants declared before the entity. For example: 
  3007.  
  3008.                                               X : typ;
  3009.                                               for X'Address use To_address (16#2000#);
  3010.  
  3011.              will be rejected, since the To_Address expression is non-static. 
  3012.              Instead write: 
  3013.  
  3014.                                               X_Address : constant Address : =
  3015.                                               To_Address   ((16#2000#);
  3016.                                               X : typ;
  3017.                                               for X'Address use X_Address;
  3018.  
  3019.              An implementation need not support a specification for the Size 
  3020.              for a given composite subtype, nor the size or storage place for 
  3021.              an object (including a component) of a given composite subtype, 
  3022.              unless the constraints on the subtype and its composite 
  3023.              subcomponents (if any) are all static constraints. Followed. Size 
  3024.              Clauses are not permitted on non-static components, as described 
  3025.              above. 
  3026.  
  3027.              An aliased component, or a component whose type is by-reference, 
  3028.              should always be allocated at an addressable location. Followed. 
  3029.  
  3030.  13.2(6-8): Packed Types 
  3031.  
  3032.            If a type is packed, then the implementation should try to minimize 
  3033.            storage allocated to objects of the type, possibly at the expense of 
  3034.            speed of accessing components, subject to reasonable complexity in 
  3035.            addressing calculations. 
  3036.            The recommended level of support pragma Pack is: 
  3037.            For a packed record type, the components should be packed as tightly 
  3038.            as possible subject to the Sizes of the component subtypes, and 
  3039.            subject to any record_representation_clause that applies to the 
  3040.            type; the implementation may, but need not, reorder components or 
  3041.            cross aligned word boundaries to improve the packing. A component 
  3042.            whose Size is greater than the word size may be allocated an 
  3043.            integral number of words. Followed. Tight packing of arrays is 
  3044.            supported for all component sizes up to 32-bits, which is the word 
  3045.            size on typical implementations of GNAT. 
  3046.  
  3047.            An implementation should support Address clauses for imported 
  3048.            subprograms. Followed. 
  3049.  
  3050.  13.3(14-19): Address Clauses 
  3051.  
  3052.            For an array X, X'Address should point at the first component of the 
  3053.            array, and not at the array bounds. Followed. 
  3054.  
  3055.            The recommended level of support for the Address attribute is: 
  3056.            X'Address should produce a useful result if X is an object that is 
  3057.            aliased or of a by-reference type, or is an entity whose Address has 
  3058.            been specified. Followed.  A valid address will be produced even if 
  3059.            none of those conditions have been met.  If necessary, the object is 
  3060.            forced into memory to ensure the address is valid. 
  3061.  
  3062.            An implementation should support Address clauses for imported 
  3063.            subprograms. Followed. 
  3064.            Objects (including subcomponents) that are aliased or of a 
  3065.            by-reference type should be allocated on storage element boundaries. 
  3066.            Followed. 
  3067.            If the Address of an object is specified, or it is imported or 
  3068.            exported, then the implementation should not perform optimizations 
  3069.            based on assumptions of no aliases. Followed. 
  3070.  
  3071.  13.3(29-35): Alignment Clauses 
  3072.  
  3073.            The recommended level of support for the Alignment attribute for 
  3074.            subtypes is: 
  3075.            An implementation should support specified Alignments that are 
  3076.            factors and multiples of the number of storage elements per word, 
  3077.            subject to the following: Followed. 
  3078.            An implementation need not support specified Alignments for 
  3079.            combinations of Sizes and Alignments that cannot be easily loaded 
  3080.            and stored by available machine instructions. Followed. 
  3081.            An implementation need not support specified Alignments that are 
  3082.            greater than the maximum Alignment the implementation ever returns 
  3083.            by default. Followed. 
  3084.  
  3085.            The recommended level of support for the Alignment attribute for 
  3086.            objects is: 
  3087.            Same as above, for subtypes, but in addition: Followed. 
  3088.            For stand-alone library-level objects of statically constrained 
  3089.            subtypes, the implementation should support all Alignments supported 
  3090.            by the target linker. For example, page alignment is likely to be 
  3091.            supported for such objects, but not for subtypes. Followed. 
  3092.  
  3093.  13.3(42-43): Size Clauses 
  3094.  
  3095.            The recommended level of support for the Size attribute of objects 
  3096.            is: 
  3097.            A Size clause should be supported for an object if the specified 
  3098.            Size is at least as large as its subtype's Size, and corresponds to 
  3099.            a size in storage elements that is a multiple of the object's 
  3100.            Alignment (if the Alignment is nonzero). Followed. 
  3101.  
  3102.  13.3(50-56): Size Clauses 
  3103.  
  3104.            If the Size of a subtype is specified, and allows for efficient 
  3105.            independent addressability (see 9.10) on the target architecture, 
  3106.            then the Size of the following objects of the subtype should equal 
  3107.            the Size of the subtype: 
  3108.            Aliased objects (including components). Followed. 
  3109.  
  3110.            Size clause on a composite subtype should not affect the internal 
  3111.            layout of components. Followed. 
  3112.  
  3113.            The recommended level of support for the Size attribute of subtypes 
  3114.            is: 
  3115.            The Size (if not specified) of a static discrete or fixed point 
  3116.            subtype should be the number of bits needed to represent each value 
  3117.            belonging to the subtype using an unbiased representation, leaving 
  3118.            space for a sign bit only if the subtype contains negative values. 
  3119.            If such a subtype is a first subtype, then an implementation should 
  3120.            support a specified Size for it that reflects this representation. 
  3121.            Followed. 
  3122.  
  3123.            For a subtype implemented with levels of indirection, the Size 
  3124.            should include the size of the pointers, but not the size of what 
  3125.            they point at. Followed. 
  3126.  
  3127.  13.3(71-73): Component Size Clauses 
  3128.  
  3129.            The recommended level of support for the Component_Size attribute 
  3130.            is: 
  3131.            An implementation need not support specified Component_Sizes that 
  3132.            are less than the Size of the component subtype. Followed. 
  3133.  
  3134.            An implementation should support specified Component_Sizes that are 
  3135.            factors and multiples of the word size. For such Component_Sizes, 
  3136.            the array should contain no gaps between components. For other 
  3137.            Component_Sizes (if supported), the array should contain no gaps 
  3138.            between components when packing is also specified; the 
  3139.            implementation should forbid this combination in cases where it 
  3140.            cannot support a no-gaps representation. Followed. 
  3141.  
  3142.  13.4(9-10): Enumeration Representation Clauses 
  3143.  
  3144.            The recommended level of support for enumeration representation 
  3145.            clauses is: 
  3146.            An implementation need not support enumeration representation 
  3147.            clauses for boolean types, but should at minimum support the 
  3148.            internal codes in the range System.Min_Int.System.Max_Int. Followed. 
  3149.  
  3150.  13.5.1(17-22): Record Representation Clauses 
  3151.  
  3152.            The recommended level of support for 
  3153.            record_representation_clauses is: 
  3154.            An implementation should support storage places that can be 
  3155.            extracted with a load, mask, shift sequence of machine code, and set 
  3156.            with a load, shift, mask, store sequence, given the available 
  3157.            machine instructions and run-time model. Followed. 
  3158.  
  3159.            A storage place should be supported if its size is equal to the Size 
  3160.            of the component subtype, and it starts and ends on a boundary that 
  3161.            obeys the Alignment of the component subtype. Followed. 
  3162.            If the default bit ordering applies to the declaration of a given 
  3163.            type, then for a component whose subtype's Size is less than the 
  3164.            word size, any storage place that does not cross an aligned word 
  3165.            boundary should be supported. Followed. 
  3166.  
  3167.            An implementation may reserve a storage place for the tag field of a 
  3168.            tagged type, and disallow other components from overlapping that 
  3169.            place. Followed. The storage place for the tag field is the 
  3170.            beginning of the tagged record, and its size is Address'Size. GNAT 
  3171.            will reject an explicit component clause for the tag field. 
  3172.  
  3173.            An implementation need not support a component_clause for a 
  3174.            component of an extension part if the storage place is not after the 
  3175.            storage places of all components of the parent type, whether or not 
  3176.            those storage places had been specified. Followed. The above advice 
  3177.            on record representation clauses is followed, and all mentioned 
  3178.            features are implemented. 
  3179.  
  3180.  13.5.2(5): Storage Place Attributes 
  3181.  
  3182.            If a component is represented using some form of pointer (such as an 
  3183.            offset) to the actual data of the component, and this data is 
  3184.            contiguous with the rest of the object, then the storage place 
  3185.            attributes should reflect the place of the actual data, not the 
  3186.            pointer. If a component is allocated discontinuously from the rest 
  3187.            of the object, then a warning should be generated upon reference to 
  3188.            one of its storage place attributes. Followed. There are no such 
  3189.            components in GNAT. 
  3190.  
  3191.  13.5.3(7-8): Bit Ordering 
  3192.  
  3193.            The recommended level of support for the non-default bit ordering 
  3194.            is: 
  3195.            If Word_Size = Storage_Unit, then the implementation should support 
  3196.            the non-default bit ordering in addition to the default bit 
  3197.            ordering. Followed. Word size does not equal storage size in this 
  3198.            implementation. Thus non-default bit ordering is not supported. 
  3199.  
  3200.  13.7(37): Address as Private 
  3201.  
  3202.            Address should be of a private type. Followed. 
  3203.  
  3204.  13.7.1(16): Address Operations 
  3205.  
  3206.            Operations in System and its children should reflect the target 
  3207.            environment semantics as closely as is reasonable. For example, on 
  3208.            most machines, it makes sense for address arithmetic to ``wrap 
  3209.            around.'' Operations that do not make sense should raise 
  3210.            Program_Error. Followed. Address arithmetic is modular arithmetic 
  3211.            that wraps around. No operation raises Program_Error, since all 
  3212.            operations make sense. 
  3213.  
  3214.  13.9(14-17): Unchecked Conversion 
  3215.  
  3216.            The Size of an array object should not include its bounds; hence, 
  3217.            the bounds should not be part of the converted data. Followed. 
  3218.  
  3219.            The implementation should not generate unnecessary run-time checks 
  3220.            to ensure that the representation of S is a representation of the 
  3221.            target type. It should take advantage of the permission to return by 
  3222.            reference when possible. Restrictions on unchecked conversions 
  3223.            should be avoided unless required by the target environment. 
  3224.            Followed. There are no restrictions on unchecked conversion. A 
  3225.            warning is generated if the source and target types do not have the 
  3226.            same size since the semantics in this case may be target dependent. 
  3227.  
  3228.            The recommended level of support for unchecked conversions is: 
  3229.            Unchecked conversions should be supported and should be reversible 
  3230.            in the cases where this clause defines the result. To enable 
  3231.            meaningful use of unchecked conversion, a contiguous representation 
  3232.            should be used for elementary subtypes, for statically constrained 
  3233.            array subtypes whose component subtype is one of the subtypes 
  3234.            described in this paragraph, and for record subtypes without 
  3235.            discriminants whose component subtypes are described in this 
  3236.            paragraph. Followed. 
  3237.  
  3238.  13.11(23-25): Implicit Heap Usage 
  3239.  
  3240.            An implementation should document any cases in which it dynamically 
  3241.            allocates heap storage for a purpose other than the evaluation of an 
  3242.            allocator. Followed, the only other points at which heap storage is 
  3243.            dynamically allocated are as follows: 
  3244.  
  3245.                1. At initial elaboration time, to allocate dynamically sized 
  3246.                   global objects. 
  3247.  
  3248.                2. To allocate space for a task when a task is created. 
  3249.  
  3250.                3. To extend the secondary stack dynamically when needed. The 
  3251.                   secondary stack is used for returning variable length 
  3252.                   results. 
  3253.  
  3254.  
  3255.              A default (implementation-provided) storage pool for an access-to- 
  3256.              constant type should not have overhead to support de-allocation of 
  3257.              individual objects. Followed. 
  3258.  
  3259.              A storage pool for an anonymous access type should be created at 
  3260.              the point of an allocator for the type, and be reclaimed when the 
  3261.              designated object becomes inaccessible. Followed. 
  3262.  
  3263.  13.11.2(17): Unchecked De-allocation 
  3264.  
  3265.            For a standard storage pool, Free should actually reclaim the 
  3266.            storage. Followed. 
  3267.  
  3268.  13.13.2(17): Stream Oriented Attributes 
  3269.  
  3270.            If a stream element is the same size as a storage element, then the 
  3271.            normal in-memory representation should be used by Read and Write for 
  3272.            scalar objects. Otherwise, Read and Write should use the smallest 
  3273.            number of stream elements needed to represent all values in the base 
  3274.            range of the scalar type. Followed. 
  3275.  
  3276.  A.1(52): Implementation Advice 
  3277.  
  3278.            If an implementation provides additional named predefined integer 
  3279.            types, then the names should end with 'Integer' as in 
  3280.            'Long_Integer'. If an implementation provides additional named 
  3281.            predefined floating point types, then the names should end with 
  3282.            'Float' as in 'Long_Float'. Followed. 
  3283.  
  3284.  A.3.2(49): Ada.Characters.Handling 
  3285.  
  3286.            If an implementation provides a localized definition of Character or 
  3287.            Wide_Character, then the effects of the subprograms in 
  3288.            Characters.Handling should reflect the localizations. See also 
  3289.            3.5.2. Followed. GNAT provides no such localized definitions. 
  3290.  
  3291.  A.4.4(106): Bounded-Length String Handling 
  3292.  
  3293.            Bounded string objects should not be implemented by implicit 
  3294.            pointers and dynamic allocation. Followed. No implicit pointers or 
  3295.            dynamic allocation are used. 
  3296.  
  3297.  A.5.2(46-47): Random Number Generation 
  3298.  
  3299.            Any storage associated with an object of type Generator should be 
  3300.            reclaimed on exit from the scope of the object. Followed. 
  3301.  
  3302.            If the generator period is sufficiently long in relation to the 
  3303.            number of distinct initiator values, then each possible value of 
  3304.            Initiator passed to Reset should initiate a sequence of random 
  3305.            numbers that does not, in a practical sense, overlap the sequence 
  3306.            initiated by any other value. If this is not possible, then the 
  3307.            mapping between initiator values and generator states should be a 
  3308.            rapidly varying function of the initiator value. Followed. The 
  3309.            generator period is sufficiently long for the first condition here 
  3310.            to hold true. 
  3311.  
  3312.  A.10.7(23): Get_Immediate 
  3313.  
  3314.            The Get_Immediate procedures should be implemented with unbuffered 
  3315.            input. For a device such as a keyboard, input should be available if 
  3316.            a key has already been typed, whereas for a disk file, input should 
  3317.            always be available except at end of file. For a file associated 
  3318.            with a keyboard-like device, any line-editing features of the 
  3319.            underlying operating system should be disabled during the execution 
  3320.            of Get_Immediate. Followed. 
  3321.  
  3322.  B.1(39-41): Pragma Export 
  3323.  
  3324.            If an implementation supports pragma Export to a given language, 
  3325.            then it should also allow the main subprogram to be written in that 
  3326.            language. It should support some mechanism for invoking the 
  3327.            elaboration of the Ada library units included in the system, and for 
  3328.            invoking the finalization of the environment task. On typical 
  3329.            systems, the recommended mechanism is to provide two subprograms 
  3330.            whose link names are adainit and adafinal. adainit should contain 
  3331.            the elaboration code for library units. adafinal should contain the 
  3332.            finalization code. These subprograms should have no effect the 
  3333.            second and subsequent time they are called. Followed. 
  3334.  
  3335.            Automatic elaboration of pre-elaborated packages should be provided 
  3336.            when pragma Export is supported. Followed when the main program is 
  3337.            in Ada. If the main program is in a foreign language, then adainit 
  3338.            must be called to elaborate pre-elaborated packages. 
  3339.  
  3340.            For each supported convention L other than Intrinsic, an 
  3341.            implementation should support Import and Export pragmas for objects 
  3342.            of L-compatible types and for subprograms, and pragma Convention for 
  3343.            L-eligible types and for subprograms, presuming the other language 
  3344.            has corresponding features. Pragma Convention need not be supported 
  3345.            for scalar types. Followed. 
  3346.  
  3347.  B.2(12-13): Package Interfaces 
  3348.  
  3349.            For each implementation-defined convention identifier, there should 
  3350.            be a child package of package Interfaces with the corresponding 
  3351.            name. This package should contain any declarations that would be 
  3352.            useful for interfacing to the language (implementation) represented 
  3353.            by the convention. Any declarations useful for interfacing to any 
  3354.            language on the given hardware architecture should be provided 
  3355.            directly in Interfaces. Followed. An additional package not defined 
  3356.            in the Ada 95 Reference Manual is Interfaces.CPP, used for 
  3357.            interfacing to C++. 
  3358.  
  3359.            An implementation supporting an interface to C, COBOL, or Fortran 
  3360.            should provide the corresponding package or packages described in 
  3361.            the following clauses. Followed. GNAT provides all the packages 
  3362.            described in this section. 
  3363.  
  3364.  B.3(63-71): Interfacing with C 
  3365.  
  3366.            An implementation should support the following interface 
  3367.            correspondences between Ada and C. Followed. 
  3368.  
  3369.            An Ada procedure corresponds to a void-returning C function. 
  3370.            Followed. 
  3371.  
  3372.            An Ada function corresponds to a non-void C function. Followed. 
  3373.  
  3374.            An Ada in scalar parameter is passed as a scalar argument to a C 
  3375.            function. Followed. 
  3376.  
  3377.            An Ada in parameter of an access-to-object type with designated type 
  3378.            T is passed as a t* argument to a C function, where t is the C type 
  3379.            corresponding to the Ada type T. Followed. 
  3380.  
  3381.            An Ada access T parameter, or an Ada out or in out parameter of an 
  3382.            elementary type T, is passed as a t* argument to a C function, where 
  3383.            t is the C type corresponding to the Ada type T. In the case of an 
  3384.            elementary out or in out parameter, a pointer to a temporary copy is 
  3385.            used to preserve by-copy semantics. Followed. 
  3386.  
  3387.            An Ada parameter of a record type T, of any mode, is passed as a t* 
  3388.            argument to a C function, where t is the C structure corresponding 
  3389.            to the Ada type T. Followed. This convention may be overridden by 
  3390.            the use of the C_Pass_By_Copy pragma, or Convention, or by 
  3391.            explicitly specifying the mechanism for a given call using an 
  3392.            extended import or export pragma. 
  3393.  
  3394.            An Ada parameter of an array type with component type T, of any 
  3395.            mode, is passed as a t* argument to a C function, where t is the C 
  3396.            type corresponding to the Ada type T. Followed. 
  3397.  
  3398.            An Ada parameter of an access-to-subprogram type is passed as a 
  3399.            pointer to a C function whose prototype corresponds to the 
  3400.            designated subprogram's specification. Followed. 
  3401.  
  3402.  B.4(95-98): Interfacing with COBOL 
  3403.  
  3404.            An Ada implementation should support the following interface 
  3405.            correspondences between Ada and COBOL. Followed. 
  3406.  
  3407.            An Ada access T parameter is passed as a ``BY REFERENCE'' data item 
  3408.            of the COBOL type corresponding to T. Followed. 
  3409.  
  3410.            An Ada in scalar parameter is passed as a ``BY CONTENT'' data item 
  3411.            of the corresponding COBOL type. Followed. 
  3412.  
  3413.            Any other Ada parameter is passed as a ``BY REFERENCE'' data item of 
  3414.            the COBOL type corresponding to the Ada parameter type; for scalars, 
  3415.            a local copy is used if necessary to ensure by-copy semantics. 
  3416.            Followed. 
  3417.  
  3418.  B.5(22-26): Interfacing with Fortran 
  3419.  
  3420.            An Ada implementation should support the following interface 
  3421.            correspondences between Ada and Fortran: Followed. 
  3422.  
  3423.            An Ada procedure corresponds to a Fortran subroutine. Followed. 
  3424.  
  3425.            An Ada function corresponds to a Fortran function. Followed. 
  3426.  
  3427.            An Ada parameter of an elementary, array, or record type T is passed 
  3428.            as a T argument to a Fortran procedure, where T is the Fortran type 
  3429.            corresponding to the Ada type T, and where the INTENT attribute of 
  3430.            the corresponding dummy argument matches the Ada formal parameter 
  3431.            mode; the Fortran implementation's parameter passing conventions are 
  3432.            used. For elementary types, a local copy is used if necessary to 
  3433.            ensure by-copy semantics. Followed. 
  3434.  
  3435.            An Ada parameter of an access-to-subprogram type is passed as a 
  3436.            reference to a Fortran procedure whose interface corresponds to the 
  3437.            designated subprogram's specification. Followed. 
  3438.  
  3439.  C.1(3-5): Access to Machine Operations 
  3440.  
  3441.            The machine code or intrinsic support should allow access to all 
  3442.            operations normally available to assembly language programmers for 
  3443.            the target environment, including privileged instructions, if any. 
  3444.            Followed. 
  3445.  
  3446.            The interfacing pragmas (see Annex B) should support interface to 
  3447.            assembler; the default assembler should be associated with the 
  3448.            convention identifier Assembler. Followed. 
  3449.  
  3450.            If an entity is exported to assembly language, then the 
  3451.            implementation should allocate it at an addressable location, and 
  3452.            should ensure that it is retained by the linking process, even if 
  3453.            not otherwise referenced from the Ada code. The implementation 
  3454.            should assume that any call to a machine code or assembler 
  3455.            subprogram is allowed to read or update every object that is 
  3456.            specified as exported. Followed. 
  3457.  
  3458.  C.1(10-16): Access to Machine Operations 
  3459.  
  3460.            The implementation should ensure that little or no overhead is 
  3461.            associated with calling intrinsic and machine-code subprograms. 
  3462.            Followed for both intrinsics and machine-code subprograms. 
  3463.  
  3464.            It is recommended that intrinsic subprograms be provided for 
  3465.            convenient access to any machine operations that provide special 
  3466.            capabilities or efficiency and that are not otherwise available 
  3467.            through the language constructs. Followed. A full set of machine 
  3468.            operation intrinsic subprograms is provided. 
  3469.  
  3470.            Atomic read-modify-write operations -- e.g., test and set, compare 
  3471.            and swap, decrement and test, enqueue /dequeue. Followed on any 
  3472.            target supporting such operations. 
  3473.  
  3474.            Standard numeric functions -- e.g., sin, log. Followed on any target 
  3475.            supporting such operations. 
  3476.  
  3477.            String manipulation operations -- e.g., translate and test. Followed 
  3478.            on any target supporting such operations. 
  3479.  
  3480.            Vector operations -- e.g., compare vector against thresholds. 
  3481.            Followed on any target supporting such operations. 
  3482.  
  3483.            Direct operations on I/O ports. Followed on any target supporting 
  3484.            such operations. 
  3485.  
  3486.  C.3(28): Interrupt Support 
  3487.  
  3488.            If the Ceiling_Locking policy is not in effect, the implementation 
  3489.            should provide means for the application to specify which interrupts 
  3490.            are to be blocked during protected actions, if the underlying system 
  3491.            allows for a finer-grain control of interrupt blocking. Followed. 
  3492.            The underlying system does not allow for finer-grain control of 
  3493.            interrupt blocking. 
  3494.  
  3495.  C.3.1(20-21): Protected Procedure Handlers 
  3496.  
  3497.            Whenever possible, the implementation should allow interrupt 
  3498.            handlers to be called directly by the hardware. Followed on any 
  3499.            target where the underlying operating system permits such direct 
  3500.            calls. 
  3501.            Whenever practical, violations of any implementation-defined 
  3502.            restrictions should be detected before run time. Followed. Compile 
  3503.            time warnings are given when possible. 
  3504.  
  3505.  C.3.2(25): Package Interrupts 
  3506.  
  3507.            If implementation-defined forms of interrupt handler procedures are 
  3508.            supported, such as protected procedures with parameters, then for 
  3509.            each such form of a handler, a type analogous to 
  3510.            Parameterless_Handler should be specified in a child package of 
  3511.            Interrupts, with the same operations as in the predefined package 
  3512.            Interrupts. Followed. 
  3513.  
  3514.  C.4(14): Pre-elaboration Requirements 
  3515.  
  3516.            It is recommended that pre-elaborated packages be implemented in 
  3517.            such a way that there should be little or no code executed at run 
  3518.            time for the elaboration of entities not already covered by the 
  3519.            Implementation Requirements. Followed. Executable code is generated 
  3520.            in some cases, e.g. loops to initialize large arrays. 
  3521.  
  3522.  C.5(8): Pragma Discard_Names 
  3523.  
  3524.            If the pragma applies to an entity, then the implementation should 
  3525.            reduce the amount of storage used for storing names associated with 
  3526.            that entity. Followed. 
  3527.  
  3528.  C.7.2(30): The Package Task_Attributes 
  3529.  
  3530.            Some implementations are targeted to domains in which memory use at 
  3531.            run time must be completely deterministic. For such implementations, 
  3532.            it is recommended that the storage for task attributes will be 
  3533.            pre-allocated statically and not from the heap. This can be 
  3534.            accomplished by either placing restrictions on the number and the 
  3535.            size of the task's attributes, or by using the pre-allocated storage 
  3536.            for the first N attribute objects, and the heap for the others. In 
  3537.            the latter case, N should be documented. Not followed. This 
  3538.            implementation is not targeted to such a domain. 
  3539.  
  3540.  D.3(17): Locking Policies 
  3541.  
  3542.            The implementation should use names that end with '_Locking' for 
  3543.            locking policies defined by the implementation. Followed. No such 
  3544.            implementation-defined locking policies exist. 
  3545.  
  3546.  D.4(16): Entry Queuing Policies 
  3547.  
  3548.            Names that end with '_Queuing' should be used for all 
  3549.            implementation-defined queuing policies. Followed. No such 
  3550.            implementation-defined queueing policies exist. 
  3551.  
  3552.  D.6(9-10): Preemptive Abort 
  3553.  
  3554.            Even though the abort_statement is included in the list of 
  3555.            potentially blocking operations (see 9.5.1), it is recommended that 
  3556.            this statement be implemented in a way that never requires the task 
  3557.            executing the abort_statement to block. Followed. 
  3558.  
  3559.            On a multi-processor, the delay associated with aborting a task on 
  3560.            another processor should be bounded; the implementation should use 
  3561.            periodic polling, if necessary, to achieve this. Followed. 
  3562.  
  3563.  D.7(21): Tasking Restrictions 
  3564.  
  3565.            When feasible, the implementation should take advantage of the 
  3566.            specified restrictions to produce a more efficient implementation. 
  3567.            GNAT currently takes advantage of these restrictions by providing an 
  3568.            optimized run time when the Ravenscar profile and the GNAT 
  3569.            restricted run time set of restrictions are specified. See pragma 
  3570.            Ravenscar and pragma Restricted_Run_Time for more details. 
  3571.  
  3572.  D.8(47-49): Monotonic Time 
  3573.  
  3574.            When appropriate, implementations should provide configuration 
  3575.            mechanisms to change the value of Tick. Such configuration 
  3576.            mechanisms are not appropriate to this implementation and are thus 
  3577.            not supported. 
  3578.  
  3579.            It is recommended that Calendar.Clock and Real_Time.Clock be 
  3580.            implemented as transformations of the same time base. Followed. 
  3581.  
  3582.            It is recommended that the best time base which exists in the 
  3583.            underlying system be available to the application through Clock. 
  3584.            Best may mean highest accuracy or largest range. Followed. 
  3585.  
  3586.  E.5(28-29): Partition Communication Subsystem 
  3587.  
  3588.            Whenever possible, the PCS on the called partition should allow for 
  3589.            multiple tasks to call the RPC-receiver with different messages and 
  3590.            should allow them to block until the corresponding subprogram body 
  3591.            returns. Followed by GLADE, a separately supplied PCS that can be 
  3592.            used with GNAT. For information on GLADE, contact Ada Core 
  3593.            Technologies. 
  3594.  
  3595.            The Write operation on a stream of type Params_Stream_Type should 
  3596.            raise Storage_Error if it runs out of space trying to write the Item 
  3597.            into the stream. Followed by GLADE, a separately supplied PCS that 
  3598.            can be used with GNAT. For information on GLADE, contact Ada Core 
  3599.            Technologies. 
  3600.  
  3601.  F(7): COBOL Support 
  3602.  
  3603.            If COBOL (respectively, C) is widely supported in the target 
  3604.            environment, implementations supporting the Information Systems 
  3605.            Annex should provide the child package Interfaces.COBOL 
  3606.            (respectively, Interfaces.C) specified in Annex B and should support 
  3607.            a convention_identifier of COBOL (respectively, C) in the 
  3608.            interfacing pragmas (see Annex B), thus allowing Ada programs to 
  3609.            interface with programs written in that language. Followed. 
  3610.  
  3611.  F.1(2): Decimal Radix Support 
  3612.  
  3613.            Packed decimal should be used as the internal representation for 
  3614.            objects of subtype S when S'Machine_Radix = 10. Not followed. GNAT 
  3615.            ignores S'Machine_Radix and always uses binary representations. 
  3616.  
  3617.  G: Numerics 
  3618.  
  3619.  
  3620.            If Fortran (respectively, C) is widely supported in the target 
  3621.            environment, implementations supporting the Numerics Annex should 
  3622.            provide the child package Interfaces.Fortran (respectively, 
  3623.            Interfaces.C) specified in Annex B and should support a 
  3624.            convention_identifier of Fortran (respectively, C) in the 
  3625.            interfacing pragmas (see Annex B), thus allowing Ada programs to 
  3626.            interface with programs written in that language. Followed. 
  3627.  
  3628.  G.1.1(56-58): Complex Types 
  3629.  
  3630.            Because the usual mathematical meaning of multiplication of a 
  3631.            complex operand and a real operand is that of the scaling of both 
  3632.            components of the former by the latter, an implementation should not 
  3633.            perform this operation by first promoting the real operand to 
  3634.            complex type and then performing a full complex multiplication. In 
  3635.            systems that, in the future, support an Ada binding to IEC 559:1989, 
  3636.            the latter technique will not generate the required result when one 
  3637.            of the components of the complex operand is infinite. (Explicit 
  3638.            multiplication of the infinite component by the zero component 
  3639.            obtained during promotion yields a NaN that propagates into the 
  3640.            final result.) Analogous advice applies in the case of 
  3641.            multiplication of a complex operand and a pure-imaginary operand, 
  3642.            and in the case of division of a complex operand by a real or 
  3643.            pure-imaginary operand. Not followed. 
  3644.  
  3645.            Similarly, because the usual mathematical meaning of addition of a 
  3646.            complex operand and a real operand is that the imaginary operand 
  3647.            remains unchanged, an implementation should not perform this 
  3648.            operation by first promoting the real operand to complex type and 
  3649.            then performing a full complex addition. In implementations in which 
  3650.            the Signed_Zeros attribute of the component type is True (and which 
  3651.            therefore conform to IEC 559:1989 in regard to the handling of the 
  3652.            sign of zero in predefined arithmetic operations), the latter 
  3653.            technique will not generate the required result when the imaginary 
  3654.            component of the complex operand is a negatively signed zero. 
  3655.            (Explicit addition of the negative zero to the zero obtained during 
  3656.            promotion yields a positive zero.) Analogous advice applies in the 
  3657.            case of addition of a complex operand and a pure-imaginary operand, 
  3658.            and in the case of subtraction of a complex operand and a real or 
  3659.            pure-imaginary operand. Not followed. 
  3660.  
  3661.            Implementations in which Real'Signed_Zeros is True should attempt to 
  3662.            provide a rational treatment of the signs of zero results and result 
  3663.            components. As one example, the result of the Argument function 
  3664.            should have the sign of the imaginary component of the parameter X 
  3665.            when the point represented by that parameter lies on the positive 
  3666.            real axis; as another, the sign of the imaginary component of the 
  3667.            Compose_From_Polar function should be the same as (respectively, the 
  3668.            opposite of) that of the Argument parameter when that parameter has 
  3669.            a value of zero and the Modulus parameter has a nonnegative 
  3670.            (respectively, negative) value. Followed. 
  3671.  
  3672.  G.1.2(49): Complex Elementary Functions 
  3673.  
  3674.            Implementations in which Complex_Types.Real'Signed_Zeros is True 
  3675.            should attempt to provide a rational treatment of the signs of zero 
  3676.            results and result components. For example, many of the complex 
  3677.            elementary functions have components that are odd functions of one 
  3678.            of the parameter components; in these cases, the result component 
  3679.            should have the sign of the parameter component at the origin. Other 
  3680.            complex elementary functions have zero components whose sign is 
  3681.            opposite that of a parameter component at the origin, or is always 
  3682.            positive or always negative. Followed. 
  3683.  
  3684.  G.2.4(19): Accuracy Requirements 
  3685.  
  3686.            The versions of the forward trigonometric functions without a Cycle 
  3687.            parameter should not be implemented by calling the corresponding 
  3688.            version with a Cycle parameter of 2.0*Numerics.Pi, since this will 
  3689.            not provide the required accuracy in some portions of the domain. 
  3690.            For the same reason, the version of Log without a Base parameter 
  3691.            should not be implemented by calling the corresponding version with 
  3692.            a Base parameter of Numerics.e. Followed. 
  3693.  
  3694.  G.2.6(15): Complex Arithmetic Accuracy 
  3695.  
  3696.            The version of the Compose_From_Polar function without a Cycle 
  3697.            parameter should not be implemented by calling the corresponding 
  3698.            version with a Cycle parameter of 2.0*Numerics.Pi, since this will 
  3699.            not provide the required accuracy in some portions of the domain. 
  3700.            Followed. 
  3701.  
  3702.  
  3703. ΓòÉΓòÉΓòÉ 7. Implementation Defined Characteristics ΓòÉΓòÉΓòÉ
  3704.  
  3705.  In addition to the implementation dependent pragmas and attributes, and the 
  3706.  implementation advice, there are a number of other features of Ada 95 that are 
  3707.  potentially implementation dependent. These are mentioned throughout the Ada 
  3708.  95 Reference Manual, and are summarized in annex M. 
  3709.  
  3710.  A requirement for conforming Ada compilers is that they provide documentation 
  3711.  describing how the implementation deals with each of these issues. In this 
  3712.  chapter, you will find each point in annex M listed followed by a description 
  3713.  in italic font of how GNAT handles the implementation dependence. 
  3714.  
  3715.  You can use this chapter as a guide to minimizing implementation dependent 
  3716.  features in your programs if portability to other compilers and other 
  3717.  operating systems is an important consideration.  The numbers in each section 
  3718.  below correspond to the paragraph number in the Ada 95 Reference Manual. 
  3719.  
  3720.  2.  Whether or not each recommendation given in Implementation Advice is 
  3721.  followed. See 1.1.2(37). 
  3722.  See Implementation Advice. 
  3723.  
  3724.  3.  Capacity limitations of the implementation. See 1.1.3(3). 
  3725.  The complexity of programs that can be processed is limited only by the total 
  3726.  amount of available virtual memory, and disk space for the generated object 
  3727.  files. 
  3728.  
  3729.  4.  Variations from the standard that are impractical to avoid given the 
  3730.  implementation's execution environment. See 1.1.3(6). 
  3731.  There are no variations from the standard. 
  3732.  
  3733.  5.  Which code_statements cause external interactions. See 1.1.3(10). 
  3734.  Any code_statement can potentially cause external interactions. 
  3735.  
  3736.  6.  The coded representation for the text of an Ada program. See 2.1(4). 
  3737.  See separate section on source representation. 
  3738.  
  3739.  7.  The control functions allowed in comments. See 2.1(14). 
  3740.  See separate section on source representation. 
  3741.  
  3742.  8.  The representation for an end of line. See 2.2(2). 
  3743.  See separate section on source representation. 
  3744.  
  3745.  9.  Maximum supported line length and lexical element length. See 2.2(15). 
  3746.  The maximum line length is 255 characters an the maximum length of a lexical 
  3747.  element is also 255 characters. 
  3748.  
  3749.  10.  Implementation defined pragmas. See 2.8(14). 
  3750.  
  3751.  See Implementation Defined Pragmas. 
  3752.  
  3753.  11.  Effect of pragma Optimize. See 2.8(27). 
  3754.  Pragma Optimize, if given with a Time or Space parameter, checks that the 
  3755.  optimization flag is set, and aborts if it is not. 
  3756.  
  3757.  12.  The sequence of characters of the value returned by S'Image when some of 
  3758.  the graphic characters of S'Wide_Image are not defined in Character. See 
  3759.  3.5(37). 
  3760.  The sequence of characters is as defined by the wide character encoding method 
  3761.  used for the source. See section on source representation for further details. 
  3762.  
  3763.  13.  The predefined integer types declared in Standard. See 3.5.4(25). 
  3764.  
  3765.  Short_Short_Integer 
  3766.            8 bit signed 
  3767.  
  3768.  Short_Integer 
  3769.            (Short) 16 bit signed 
  3770.  
  3771.  Integer 
  3772.            32 bit signed 
  3773.  
  3774.  Long_Integer 
  3775.            32 bit signed 
  3776.  
  3777.  Long_Long_Integer 
  3778.            64 bit signed 
  3779.  
  3780.  
  3781.  14.  Any nonstandard integer types and the operators defined for them. See 
  3782.  3.5.4(26). 
  3783.  There are no nonstandard integer types. 
  3784.  
  3785.  15.  Any nonstandard real types and the operators defined for them. See 
  3786.  3.5.6(8). 
  3787.  There are no nonstandard real types. 
  3788.  
  3789.  16.  What combinations of requested decimal precision and range are supported 
  3790.  for floating point types. See 3.5.7(7). 
  3791.  The precision and range is as defined by the IEEE standard. 
  3792.  
  3793.  17.  The predefined floating point types declared in Standard. See 3.5.7(16). 
  3794.  
  3795.  Short_Float 
  3796.            32 bit IEEE short 
  3797.  
  3798.  Float 
  3799.            (Short) 32 bit IEEE short 
  3800.  
  3801.  Long_Float 
  3802.            64 bit IEEE long 
  3803.  
  3804.  Long_Long_Float 
  3805.            64 bit IEEE long (80 bit IEEE long on x86 processors) 
  3806.  
  3807.  
  3808.  18.  The small of an ordinary fixed point type. See 3.5.9(8). 
  3809.  Fine_Delta is 2**(-63) 
  3810.  
  3811.  19.  What combinations of small, range, and digits are supported for fixed 
  3812.  point types. See 3.5.9(10). 
  3813.  Any combinations are permitted that do not result in a small less than 
  3814.  Fine_Delta and do not result in a mantissa larger than 63 bits. 
  3815.  
  3816.  20.  The result of Tags.Expanded_Name for types declared within an unnamed 
  3817.  block_statement. See 3.9(10). 
  3818.  Block numbers of the form Bnnn, where nnn is a decimal integer are allocated. 
  3819.  
  3820.  21.  Implementation-defined attributes. See 4.1.4(12). 
  3821.  See Implementation Defined Attributes. 
  3822.  
  3823.  22.  Any implementation-defined time types. See 9.6(6). 
  3824.  There are no implementation-defined time types. 
  3825.  
  3826.  23.  The time base associated with relative delays. 
  3827.  See 9.6(20). The time base used is that provided by the C library function 
  3828.  gettimeofday. 
  3829.  
  3830.  24.  The time base of the type Calendar.Time. See 9.6(23). 
  3831.  The time base used is that provided by the C library function gettimeofday. 
  3832.  
  3833.  25.  The time zone used for package Calendar operations. See 9.6(24). 
  3834.  The time zone used by package Calendar is the current system time zone setting 
  3835.  for local time, as accessed by the C library function localtime. 
  3836.  
  3837.  26.  Any limit on delay_until_statements of select_statements. See 9.6(29). 
  3838.  There are no such limits. 
  3839.  
  3840.  27.  Whether or not two non overlapping parts of a composite object are 
  3841.  independently addressable, in the case where packing, record layout, or 
  3842.  Component_Size is specified for the object. See 9.10(1). 
  3843.  Separate components are independently addressable if they do not share 
  3844.  overlapping storage units. 
  3845.  
  3846.  28.  The representation for a compilation. See 10.1(2). 
  3847.  A compilation is represented by a sequence of files presented to the compiler 
  3848.  in a single invocation of the 'gcc' command. 
  3849.  
  3850.  29.  Any restrictions on compilations that contain multiple compilation_units. 
  3851.  See 10.1(4). 
  3852.  No single file can contain more than one compilation unit, but any sequence of 
  3853.  files can be presented to the compiler as a single compilation. 
  3854.  
  3855.  30.  The mechanisms for creating an environment and for adding and replacing 
  3856.  compilation units. See 10.1.4(3). 
  3857.  See separate section on compilation model. 
  3858.  
  3859.  31.  The manner of explicitly assigning library units to a partition. See 
  3860.  10.2(2). 
  3861.  See separate section on binding and linking programs. 
  3862.  
  3863.  32.  The implementation-defined means, if any, of specifying which compilation 
  3864.  units are needed by a given compilation unit. See 10.2(2). 
  3865.  See separate section on compilation unit. 
  3866.  
  3867.  33.  The manner of designating the main subprogram of a partition. See 
  3868.  10.2(7). 
  3869.  The main program is designated by providing the name of the corresponding ali 
  3870.  file as the input parameter to the binder. 
  3871.  
  3872.  34.  The order of elaboration of library_items. See 10.2(18). 
  3873.  The first constraint on ordering is that it meets the requirements of chapter 
  3874.  10 of the Ada 95 Reference Manual. This still leaves some implementation 
  3875.  dependent choices, which are resolved by first elaborating bodies as early as 
  3876.  possible (i.e. in preference to specs where there is a choice), and second by 
  3877.  evaluating the immediate with clauses of a unit to determine the probably best 
  3878.  choice, and third by elaborating in alphabetical order of unit names where a 
  3879.  choice still remains. 
  3880.  
  3881.  35.  Parameter passing and function return for the main subprogram. See 
  3882.  10.2(21). 
  3883.  The main program has no parameters. It may be a procedure, or a function 
  3884.  returning an integer type. In the latter case, the returned integer value is 
  3885.  the return code of the program. 
  3886.  
  3887.  36.  The mechanisms for building and running partitions. See 10.2(24). 
  3888.  GNAT itself supports programs with only a single partition. The GNATDIST tool 
  3889.  provided with the GLADE package (which also includes an implementation of the 
  3890.  PCS) provides a completely flexible method for building and running programs 
  3891.  consisting of multiple partitions. See the separate GLADE manual for details. 
  3892.  
  3893.  37.  The details of program execution, including program termination. See 
  3894.  10.2(25). 
  3895.  See separate section on compilation model. 
  3896.  
  3897.  38.  The semantics of any non-active partitions supported by the 
  3898.  implementation. See 10.2(28). 
  3899.  Passive partitions are supported on targets where shared memory is provided by 
  3900.  the operating system. See the GLADE reference manual for further details. 
  3901.  
  3902.  39.  The information returned by Exception_Message. See 11.4.1(10). 
  3903.  Exception message returns the null string unless a specific message has been 
  3904.  passed by the program. 
  3905.  
  3906.  40.  The result of Exceptions.Exception_Name for types declared within an 
  3907.  unnamed block_statement. See 11.4.1(12). 
  3908.  Blocks have implementation defined names of the form Bnnn where nnn is an 
  3909.  integer. 
  3910.  
  3911.  41.  The information returned by Exception_Information. See 11.4.1(13). 
  3912.  Exception_Information contains the expanded name of the exception in upper 
  3913.  case, and no other information. 
  3914.  
  3915.  42.  Implementation-defined check names. See 11.5(27). 
  3916.  No implementation-defined check names are supported. 
  3917.  
  3918.  43.  The interpretation of each aspect of representation. See 13.1(20). 
  3919.  See separate section on data representations. 
  3920.  
  3921.  44.  Any restrictions placed upon representation items. See 13.1(20). 
  3922.  See separate section on data representations. 
  3923.  
  3924.  45.  The meaning of Size for indefinite subtypes. See 13.3(48). 
  3925.  Size for an indefinite subtype is the maximum possible size, except that for 
  3926.  the case of a subprogram parameter, the size of the parameter object is the 
  3927.  actual size. 
  3928.  
  3929.  46.  The default external representation for a type tag. See 13.3(75). 
  3930.  The default external representation for a type tag is the fully expanded name 
  3931.  of the type in upper case letters. 
  3932.  
  3933.  47.  What determines whether a compilation unit is the same in two different 
  3934.  partitions. See 13.3(76). 
  3935.  A compilation unit is the same in two different partitions if and only if it 
  3936.  derives from the same source file. 
  3937.  
  3938.  48.  Implementation-defined components. See 13.5.1(15). 
  3939.  The only implementation defined component is the tag for a tagged type, which 
  3940.  contains a pointer to the dispatching table. 
  3941.  
  3942.  49.  If Word_Size = Storage_Unit, the default bit ordering. See 13.5.3(5). 
  3943.  Word_Size (32) is not the same as Storage_Unit (8) for this implementation, so 
  3944.  no non-default bit ordering is supported. The default bit ordering corresponds 
  3945.  to the natural endianness of the target architecture. 
  3946.  
  3947.  50.  The contents of the visible part of package System and its 
  3948.  language-defined children. See 13.7(2). 
  3949.  See the definition of these packages in files 'system.ads' and 's-stoele.ads'. 
  3950.  
  3951.  51.  The contents of the visible part of package System.Machine_Code, and the 
  3952.  meaning of code_statements. See 13.8(7). 
  3953.  See the definition and documentation in file 's-maccod.ads'. 
  3954.  
  3955.  52.  The effect of unchecked conversion. See 13.9(11). 
  3956.  Unchecked conversion between types of the same size and results in an 
  3957.  uninterpreted transmission of the bits from one type to the other. If the 
  3958.  types are of unequal sizes, then in the case of discrete types, a shorter 
  3959.  source is first zero or sign extended as necessary, and a shorter target is 
  3960.  simply truncated on the left. For all non-discrete types, the source is first 
  3961.  copied if necessary to ensure that the alignment requirements of the target 
  3962.  are met, then a pointer is constructed to the source value, and the result is 
  3963.  obtained by dereferencing this pointer after converting it to be a pointer to 
  3964.  the target type. 
  3965.  
  3966.  53.  The manner of choosing a storage pool for an access type when 
  3967.  Storage_Pool is not specified for the type. See 13.11(17). 
  3968.  There are 3 different standard pools used by the compiler when Storage_Pool is 
  3969.  not specified depending whether the type is local to a subprogram or defined 
  3970.  at the library level and whether Storage_Sizeis specified or not. See 
  3971.  documentation in the runtime library units System.Pool_Global, 
  3972.  System.Pool_Size and System.Pool_Local in files 's-poosiz.ads', 's-pooglo.ads' 
  3973.  and 's-pooloc.ads' for full details on the default pools used. 
  3974.  
  3975.  54.  Whether or not the implementation provides user-accessible names for the 
  3976.  standard pool type(s). See 13.11(17). 
  3977.  
  3978.  See documentation in the sources of the run time mentioned in paragraph 53 . 
  3979.  All these pools are accessible by means of with'ing these units. 
  3980.  
  3981.  55.  The meaning of Storage_Size. See 13.11(18). 
  3982.  Storage_Size is measured in storage units, and refers to the total space 
  3983.  available for an access type collection, or to the primary stack space for a 
  3984.  task. 
  3985.  
  3986.  56.  Implementation-defined aspects of storage pools. See 13.11(22). 
  3987.  See documentation in the sources of the run time mentioned in paragraph 53 for 
  3988.  details on GNAT-defined aspects of storage pools. 
  3989.  
  3990.  57.  The set of restrictions allowed in a pragma Restrictions. See 13.12(7). 
  3991.  All RM defined Restriction identifiers are implemented. The following 
  3992.  additional restriction identifiers are provided. There are two separate lists 
  3993.  of implementation dependent restriction identifiers. The first set requires 
  3994.  consistency throughout a partition (in other words, if the restriction 
  3995.  identifier is used for any unit in the partition, then all units in the 
  3996.  partition must obey the restriction. 
  3997.  
  3998.  Boolean_Entry_Barriers 
  3999.            This restriction ensures at compile time that barriers in entry 
  4000.            declarations for protected types are restricted to references to 
  4001.            simple boolean variables defined in the private part of the 
  4002.            protected type. No other form of entry barriers is permitted. This 
  4003.            is one of the restrictions of the Ravenscar profile for limited 
  4004.            tasking (see also pragma Ravenscar). 
  4005.  
  4006.  Max_Entry_Queue_Depth => Expr 
  4007.            This restriction is a declaration that any protected entry compiled 
  4008.            in the scope of the restriction has at most the specified number of 
  4009.            tasks waiting on the entry at any one time, and so no queue is 
  4010.            required. This restriction is not checked at compile time. A program 
  4011.            execution is erroneous if an attempt is made to queue more than the 
  4012.            specified number of tasks on such an entry. 
  4013.  
  4014.  No_Calendar 
  4015.            This restriction ensures at compile time that there is no implicit 
  4016.            or explicit dependence on the package Ada.Calendar. 
  4017.  
  4018.  No_Dynamic_Interrupts 
  4019.            This restriction ensures at compile time that there is no attempt to 
  4020.            dynamically associate interrupts. Only static association is 
  4021.            allowed. 
  4022.  
  4023.  No_Enumeration_Maps 
  4024.            This restriction ensures at compile time that no operations 
  4025.            requiring enumeration maps are used (that is Image and Value 
  4026.            attributes applied to enumeration types). 
  4027.  
  4028.  No_Entry_Calls_In_Elaboration_Code 
  4029.            This restriction ensures at compile time that no task or protected 
  4030.            entry calls are made during elaboration code. As a result of the use 
  4031.            of this restriction, the compiler can assume that no code past an 
  4032.            accept statement in a task can be executed at elaboration time. 
  4033.  
  4034.  No_Exception_Handlers 
  4035.            This restriction ensures at compile time that there are no explicit 
  4036.            exception handlers. 
  4037.  
  4038.  No_Implicit_Conditionals 
  4039.            This restriction ensures that the generated code does not contain 
  4040.            any implicit conditionals, either by modifying the generated code 
  4041.            where possible, or by rejecting any construct that would otherwise 
  4042.            generate an implicit conditional. The details and use of this 
  4043.            restriction are described in more detail in the GNORT Reference 
  4044.            Manual. 
  4045.  
  4046.  No_Implicit_Conditionals 
  4047.            This restriction ensures that the generated code does not contain 
  4048.            any implicit for loops, either by modifying the generated code where 
  4049.            possible, or by rejecting any construct that would otherwise 
  4050.            generate an implicit for loop. The details and use of this 
  4051.            restriction are described in more detail in the GNORT Reference 
  4052.            Manual. 
  4053.  
  4054.  No_Local_Protected_Objects 
  4055.            This restriction ensures at compile time that protected objects are 
  4056.            only declared at the library level. 
  4057.  
  4058.  No_Protected_Type_Allocators 
  4059.            This restriction ensures at compile time that there are no allocator 
  4060.            expressions that attempt to allocate protected objects. 
  4061.  
  4062.  No_Select_Statements 
  4063.            This restriction ensures at compile time no select statements of any 
  4064.            kind are permitted, that is the keyword select may not appear. This 
  4065.            is one of the restrictions of the Ravenscar profile for limited 
  4066.            tasking (see also pragma Ravenscar). 
  4067.  
  4068.  No_Standard_Storage_Pools 
  4069.            This restriction ensures at compile time that no access types use 
  4070.            the standard default storage pool. Any access type declared must 
  4071.            have an explicit Storage_Pool attribute defined specifying a 
  4072.            user-defined storage pool. 
  4073.  
  4074.  No_Streams 
  4075.            This restriction ensures at compile time that there are no implicit 
  4076.            or explicit dependencies on the package Ada.Streams. 
  4077.  
  4078.  No_Task_Attributes 
  4079.            This restriction ensures at compile time that there are no implicit 
  4080.            or explicit dependencies on the package Ada.Task_Attributes. 
  4081.  
  4082.  No_Task_Termination 
  4083.            This restriction ensures at compile time that no terminate 
  4084.            alternatives appear in any task body. 
  4085.  
  4086.  No_Wide_Characters 
  4087.            This restriction ensures at compile time that no uses of the types 
  4088.            Wide_Character or Wide_String appear, and that no wide character 
  4089.            literals appear in the program (that is literals representing 
  4090.            characters not in type Character. 
  4091.  
  4092.  Static_Priorities 
  4093.            This restriction ensures at compile time that all priority 
  4094.            expressions are static, and that there are no dependencies on the 
  4095.            package Ada.Dynamic_Priorities. 
  4096.  
  4097.  Static_Storage_Size 
  4098.            This restriction ensures at compile time that any expression 
  4099.            appearing in a Storage_Size pragma or attribute definition clause is 
  4100.            static. 
  4101.  
  4102.  The second set of implementation dependent attributes does not require 
  4103.  partition-wide consistency. The restriction may be enforced for a single unit 
  4104.  without any effect on any of the other units in the partition. 
  4105.  
  4106.  No_Elaboration_Code 
  4107.            This restriction ensures at compile time that no elaboration code is 
  4108.            generated. Note that this is not the same condition as is enforced 
  4109.            by pragma Preelaborate. There are cases in which pragma Preelaborate 
  4110.            still permits code to be generated (e.g. code to initialize a large 
  4111.            array to all zeroes), and there are cases of units which do not meet 
  4112.            the requirements for pragma Preelaborate, but for which no 
  4113.            elaboration code is generated. Generally, it is the case that 
  4114.            preelaborable units will meet the restrictions, with the exception 
  4115.            of large aggregates initialized by others. 
  4116.  
  4117.  No_Entry_Queue 
  4118.            This restriction is a declaration that any protected entry compiled 
  4119.            in the scope of the restriction has at most one task waiting on the 
  4120.            entry at any one time, and so no queue is required. This restriction 
  4121.            is not checked at compile time. A program execution is erroneous if 
  4122.            an attempt is made to queue a second task on such an entry. 
  4123.  
  4124.  No_Implementation_Attributes 
  4125.            This restriction checks at compile time that no GNAT-defined 
  4126.            attributes are present. With this restriction, the only attributes 
  4127.            that can be used are those defined in the Ada 95 Reference Manual. 
  4128.  
  4129.  No_Implementation_Pragmas 
  4130.            This restriction checks at compile time that no GNAT-defined pragmas 
  4131.            are present. With this restriction, the only pragmas that can be 
  4132.            used are those defined in the Ada 95 Reference Manual. 
  4133.  
  4134.  No_Implementation_Restrictions 
  4135.            This restriction checks at compile time that no GNAT-defined 
  4136.            restriction identifiers (other than No_Implementation_Restrictions 
  4137.            itself) are present. With this restriction, the only other 
  4138.            restriction identifiers that can be used are those defined in the 
  4139.            Ada 95 Reference Manual. 
  4140.  
  4141.  
  4142.  58.  The consequences of violating limitations on Restrictions pragmas. See 
  4143.  13.12(9). 
  4144.  Restrictions that can be checked at compile time result in illegalities if 
  4145.  violated. Currently there are no other consequences of violating restrictions. 
  4146.  
  4147.  59.  The representation used by the Read and Write attributes of elementary 
  4148.  types in terms of stream elements. See 13.13.2(9). 
  4149.  The representation is the in-memory representation of the base type of the 
  4150.  type, using the number of bits corresponding to the type'Size value, and the 
  4151.  natural ordering of the machine. 
  4152.  
  4153.  60.  The names and characteristics of the numeric subtypes declared in the 
  4154.  visible part of package Standard. See A.1(3). 
  4155.  See items describing the integer and floating-point types supported. 
  4156.  
  4157.  61.  The accuracy actually achieved by the elementary functions. See A.5.1(1). 
  4158.  The elementary functions correspond to the functions available in the C 
  4159.  library. Only fast math mode is implemented. 
  4160.  
  4161.  62.  The sign of a zero result from some of the operators or functions in 
  4162.  Numerics.Generic_Elementary_Functions, when Float_Type'Signed_Zeros is True. 
  4163.  See A.5.1(46). 
  4164.  The sign of zeroes follows the requirements of the IEEE 754 standard on 
  4165.  floating-point. 
  4166.  
  4167.  63.  The value of Numerics.Float_Random.Max_Image_Width. See A.5.2(27). 
  4168.  Maximum image width is 649, see library file 'a-numran.ads'. 
  4169.  
  4170.  64.  The value of Numerics.Discrete_Random.Max_Image_Width. See A.5.2(27). 
  4171.  Maximum image width is 80, see library file 'a-nudira.ads'. 
  4172.  
  4173.  65.  The algorithms for random number generation. See A.5.2(32). 
  4174.  The algorithm is documented in the source files 'a-numran.ads' and 
  4175.  'a-numran.adb'. 
  4176.  
  4177.  66.  The string representation of a random number generator's state. See 
  4178.  A.5.2(38). 
  4179.  See the documentation contained in the file 'a-numran.adb'. 
  4180.  
  4181.  67.  The minimum time interval between calls to the time-dependent Reset 
  4182.  procedure that are guaranteed to initiate different random number sequences. 
  4183.  See A.5.2(45). 
  4184.  The minimum period between reset calls to guarantee distinct series of random 
  4185.  numbers is one microsecond. 
  4186.  
  4187.  68.  The values of the Model_Mantissa, Model_Emin, Model_Epsilon, Model, 
  4188.  Safe_First, and Safe_Last attributes, if the Numerics Annex is not supported. 
  4189.  See A.5.3(72). 
  4190.  See the source file 'ttypef.ads' for the values of all numeric attributes. 
  4191.  
  4192.  69.  Any implementation-defined characteristics of the input-output packages. 
  4193.  See A.7(14). 
  4194.  There are no special implementation defined characteristics for these 
  4195.  packages. 
  4196.  
  4197.  70.  The value of Buffer_Size in Storage_IO. See A.9(10). 
  4198.  All type representations are contiguous, and the Buffer_Size is the value of 
  4199.  type'Size rounded up to the next storage unit boundary. 
  4200.  
  4201.  71.  External files for standard input, standard output, and standard error 
  4202.  See A.10(5). 
  4203.  These files are mapped onto the files provided by the C streams libraries. See 
  4204.  source file 'i-cstrea.ads' for further details. 
  4205.  
  4206.  72.  The accuracy of the value produced by Put. See A.10.9(36). 
  4207.  If more digits are requested in the output than are represented by the 
  4208.  precision of the value, zeroes are output in the corresponding least 
  4209.  significant digit positions. 
  4210.  
  4211.  73.  The meaning of Argument_Count, Argument, and Command_Name. See A.15(1). 
  4212.  These are mapped onto the argv and argc parameters of the main program in the 
  4213.  natural manner. 
  4214.  
  4215.  74.  Implementation-defined convention names. See B.1(11). 
  4216.  The following convention names are supported 
  4217.  
  4218.  Ada 
  4219.            Ada 
  4220.  
  4221.  Asm 
  4222.            Assembly language 
  4223.  
  4224.  Assembler 
  4225.            Assembly language 
  4226.  
  4227.  C 
  4228.            C 
  4229.  
  4230.  C_Pass_By_Copy 
  4231.            Treated like C, except for record types 
  4232.  
  4233.  COBOL 
  4234.            COBOL 
  4235.  
  4236.  CPP 
  4237.            C++ 
  4238.  
  4239.  Default 
  4240.            Treated the same as C 
  4241.  
  4242.  DLL 
  4243.            DLL (used for Windows implementations only) is handled like the 
  4244.            Stdcall convention. This convention is used to access variables and 
  4245.            functions (with Stdcall convention) in a DLL. 
  4246.  
  4247.  External 
  4248.            Treated the same as C 
  4249.  
  4250.  Fortran 
  4251.            Fortran 
  4252.  
  4253.  Intrinsic 
  4254.            Intrinsic 
  4255.  
  4256.  Stdcall 
  4257.            Stdcall (used for Windows implementations only). This convention 
  4258.            correspond to the WINAPI (previously called Pascal convention) C/C++ 
  4259.            convention under Windows. A function with this convention clean the 
  4260.            stack before exit. 
  4261.  
  4262.  Stubbed 
  4263.            Stubbed is a special convention used to indicate that the body of 
  4264.            the subprogram will be entirely ignored. Any call to the subprogram 
  4265.            is converted into a raise of the Program_Error exception. If a 
  4266.            pragma Import specifies convention stubbed then no body need be 
  4267.            present at all. This convention is useful during development for the 
  4268.            inclusion of subprograms whose body has not yet been written. 
  4269.  
  4270.  In addition, all otherwise unrecognized convention names are also treated as 
  4271.  being synonymous with convention C. In all implementations except for VMS, use 
  4272.  of such other names results in a warning. In VMS implementations, these names 
  4273.  are accepted silently. 
  4274.  
  4275.  75.  The meaning of link names. See B.1(36). 
  4276.  Link names are the actual names used by the linker. 
  4277.  
  4278.  76.  The manner of choosing link names when neither the link name nor the 
  4279.  address of an imported or exported entity is specified. See B.1(36). 
  4280.  The default linker name is that which would be assigned by the relevant 
  4281.  external language, interpreting the Ada name as being in all lower case 
  4282.  letters. 
  4283.  
  4284.  77.  The effect of pragma Linker_Options. See B.1(37). 
  4285.  The string passed to Linker_Options is presented uninterpreted as an argument 
  4286.  to the link command. 
  4287.  
  4288.  78.  The contents of the visible part of package Interfaces and its 
  4289.  language-defined descendants. See B.2(1). 
  4290.  See files with prefix 'i-' in the distributed library. 
  4291.  
  4292.  79.  Implementation-defined children of package Interfaces. The contents of 
  4293.  the visible part of package Interfaces. See B.2(11). 
  4294.  See files with prefix 'i-' in the distributed library. 
  4295.  
  4296.  80.  The types Floating, Long_Floating, Binary, Long_Binary, Decimal_ Element, 
  4297.  and COBOL_Character; and the initialization of the variables Ada_To_COBOL and 
  4298.  COBOL_To_Ada, in Interfaces.COBOL. See B.4(50). 
  4299.  
  4300.  Floating 
  4301.            Float 
  4302.  
  4303.  Long_Floating 
  4304.            (Floating) Long_Float 
  4305.  
  4306.  Binary 
  4307.            Integer 
  4308.  
  4309.  Long_Binary 
  4310.            Long_Long_Integer 
  4311.  
  4312.  Decimal_Element 
  4313.            Character 
  4314.  
  4315.  COBOL_Character 
  4316.            Character 
  4317.  
  4318.  For initialization, see the file 'i-cobol.ads' in the distributed library. 
  4319.  
  4320.  81.  Support for access to machine instructions. See C.1(1). 
  4321.  See documentation in file 's-maccod.ads' in the distributed library. 
  4322.  
  4323.  82.  Implementation-defined aspects of access to machine operations. See 
  4324.  C.1(9). 
  4325.  See documentation in file 's-maccod.ads' in the distributed library. 
  4326.  
  4327.  83.  Implementation-defined aspects of interrupts. See C.3(2). 
  4328.  Interrupts are mapped to signals or conditions as appropriate. See definition 
  4329.  of unit Ada.Interrupt_Names in source file 'a-intnam.ads' for details on the 
  4330.  interrupts supported on a particular target. 
  4331.  
  4332.  84.  Implementation-defined aspects of pre-elaboration. See C.4(13). 
  4333.  GNAT does not permit a partition to be restarted without reloading, except 
  4334.  under control of the debugger. 
  4335.  
  4336.  85.  The semantics of pragma Discard_Names. See C.5(7). 
  4337.  Pragma Discard_Names causes names of enumeration literals to be suppressed. In 
  4338.  the presence of this pragma, the Image attribute provides the image of the Pos 
  4339.  of the literal, and Value accepts Pos values. 
  4340.  
  4341.  86.  The result of the Task_Identification.Image attribute. See C.7.1(7). 
  4342.  The result of this attribute is an 8-digit hexadecimal string representing the 
  4343.  virtual address of the task control block. 
  4344.  
  4345.  87.  The value of Current_Task when in a protected entry or interrupt handler. 
  4346.  See C.7.1(17). 
  4347.  Protected entries or interrupt handlers can be executed by any convenient 
  4348.  thread, so the value of Current_Task is undefined. 
  4349.  
  4350.  88.  The effect of calling Current_Task from an entry body or interrupt 
  4351.  handler. See C.7.1(19). 
  4352.  The effect of calling Current_Task from an entry body or interrupt handler is 
  4353.  to return the identification of the task currently executing the code. 
  4354.  
  4355.  89.  Implementation-defined aspects of Task_Attributes. See C.7.2(19). 
  4356.  There are no implementation-defined aspects of Task_Attributes. 
  4357.  
  4358.  90.  Values of all Metrics. See D(2). 
  4359.  The metrics information for GNAT depends on the performance of the unerlying 
  4360.  operating system. The sources of the run-time for tasking implementation, 
  4361.  together with the output from -gnatG can be used to determine the exact 
  4362.  sequence of operating systems calls made to implement various tasking 
  4363.  constructs. Together with appropriate information on the performance of the 
  4364.  underlying operating system, on the exact target in use, this information can 
  4365.  be used to determine the required metrics. 
  4366.  
  4367.  91.  The declarations of Any_Priority and Priority. See D.1(11). 
  4368.  See declarations in file 'system.ads'. 
  4369.  
  4370.  92.  Implementation-defined execution resources. See D.1(15). 
  4371.  There are no implementation-defined execution resources. 
  4372.  
  4373.  93.  Whether, on a multiprocessor, a task that is waiting for access to a 
  4374.  protected object keeps its processor busy. See D.2.1(3). 
  4375.  On a multi-processor, a task that is waiting for access to a protected object 
  4376.  does not keep its processor busy. 
  4377.  
  4378.  94.  The affect of implementation defined execution resources on task 
  4379.  dispatching. See D.2.1(9). 
  4380.  Tasks map to threads in the threads package used by GNAT. Where possible and 
  4381.  appropriate, these threads correspond to native threads of the underlying 
  4382.  operating system. 
  4383.  
  4384.  95.  Implementation-defined policy_identifiers allowed in a pragma 
  4385.  Task_Dispatching_Policy. See D.2.2(3). 
  4386.  There are no implementation-defined policy-identifiers allowed in this pragma. 
  4387.  
  4388.  96.  Implementation-defined aspects of priority inversion. See D.2.2(16). 
  4389.  Execution of a task cannot be preempted by the implementation processing of 
  4390.  delay expirations for lower priority tasks. 
  4391.  
  4392.  97.  Implementation defined task dispatching. See D.2.2(18). 
  4393.  The policy is the same as that of the underlying threads implementation. 
  4394.  
  4395.  98.  Implementation-defined policy_identifiers allowed in a pragma 
  4396.  Locking_Policy. See D.3(4). 
  4397.  There are no implementation defined policy identifiers allowed in this pragma. 
  4398.  
  4399.  99.  Default ceiling priorities. See D.3(10). 
  4400.  The ceiling priority of protected objects of the type 
  4401.  System.Interrupt_Priority'Last as described in the Ada 95 Reference Manual 
  4402.  D.3(10), 
  4403.  
  4404.  100.  The ceiling of any protected object used internally by the 
  4405.  implementation. See D.3(16). 
  4406.  The ceiling priority of internal protected objects is System.Priority'Last. 
  4407.  
  4408.  101.  Implementation-defined queuing policies. See D.4(1). 
  4409.  There are no implementation-defined queueing policies. 
  4410.  
  4411.  102.  On a multiprocessor, any conditions that cause the completion of an 
  4412.  aborted construct to be delayed later than what is specified for a single 
  4413.  processor. See D.6(3). 
  4414.  The semantics for abort on a multi-processor is the same as on a single 
  4415.  processor, there are no further delays. 
  4416.  
  4417.  103.  Any operations that implicitly require heap storage allocation. See 
  4418.  D.7(8). 
  4419.  The only operation that implicitly requires heap storage allocation is task 
  4420.  creation. 
  4421.  
  4422.  104.  Implementation-defined aspects of pragma Restrictions. See D.7(20). 
  4423.  There are no such implementation-defined aspects. 
  4424.  
  4425.  105.  Implementation-defined aspects of package Real_Time. See D.8(17). 
  4426.  There are no implementation defined aspects of package Real_Time. 
  4427.  
  4428.  106.  Implementation-defined aspects of delay_statements. See D.9(8). 
  4429.  Any difference greater than one microsecond will cause the task to be delayed 
  4430.  (see D.9(7)). 
  4431.  
  4432.  107.  The upper bound on the duration of interrupt blocking caused by the 
  4433.  implementation. See D.12(5). 
  4434.  The upper bound is determined by the underlying operating system. In no cases 
  4435.  is it more than 10 milliseconds. 
  4436.  
  4437.  108.  The means for creating and executing distributed programs. See E(5). 
  4438.  The GLADE package provides a utility GNATDIST for creating and executing 
  4439.  distributed programs. See the GLADE reference manual for further details. 
  4440.  
  4441.  109.  Any events that can result in a partition becoming inaccessible. See 
  4442.  E.1(7). 
  4443.  See the GLADE reference manual for full details on such events. 
  4444.  
  4445.  110.  The scheduling policies, treatment of priorities, and management of 
  4446.  shared resources between partitions in certain cases. See E.1(11). 
  4447.  See the GLADE reference manual for full details on these aspects of 
  4448.  multi-partition execution. 
  4449.  
  4450.  111.  Events that cause the version of a compilation unit to change. See 
  4451.  E.3(5). 
  4452.  Editing the source file of a compilation unit, or the source files of any 
  4453.  units on which it is dependent in a significant way cause the version to 
  4454.  change. No other actions cause the version number to change. All changes are 
  4455.  significant except those which affect only layout, capitalization or comments. 
  4456.  
  4457.  112.  Whether the execution of the remote subprogram is immediately aborted as 
  4458.  a result of cancellation. See E.4(13). 
  4459.  See the GLADE reference manual for details on the effect of abort in a 
  4460.  distributed application. 
  4461.  
  4462.  113.  Implementation-defined aspects of the PCS. See E.5(25). 
  4463.  See the GLADE reference manual for a full description of all implementation 
  4464.  defined aspects of the PCS. 
  4465.  
  4466.  114.  Implementation-defined interfaces in the PCS. See E.5(26). 
  4467.  See the GLADE reference manual for a full description of all implementation 
  4468.  defined interfaces. 
  4469.  
  4470.  115.  The values of named numbers in the package Decimal. See F.2(7). 
  4471.  
  4472.  Max_Scale 
  4473.            +18 
  4474.  
  4475.  Min_Scale 
  4476.            -18 
  4477.  
  4478.  Min_Delta 
  4479.            1.0E-18 
  4480.  
  4481.  Max_Delta 
  4482.            1.0E+18 
  4483.  
  4484.  Max_Decimal_Digits 
  4485.            18 
  4486.  
  4487.  
  4488.  116.  The value of Max_Picture_Length in the package Text_IO.Editing. See 
  4489.  F.3.3(16). 
  4490.  64 
  4491.  
  4492.  117.  The value of Max_Picture_Length in the package Wide_Text_IO.Editing. See 
  4493.  F.3.4(5). 
  4494.  64 
  4495.  
  4496.  118.  The accuracy actually achieved by the complex elementary functions and 
  4497.  by other complex arithmetic operations. See G.1(1). 
  4498.  Standard library functions are used for the complex arithmetic operations. 
  4499.  Only fast math mode is currently supported. 
  4500.  
  4501.  119.  The sign of a zero result (or a component thereof) from any operator or 
  4502.  function in Numerics.Generic_Complex_Types, when Real'Signed_Zeros is True. 
  4503.  See G.1.1(53). 
  4504.  The signs of zero values are as recommended by the relevant implementation 
  4505.  advice. 
  4506.  
  4507.  120.  The sign of a zero result (or a component thereof) from any operator or 
  4508.  function in Numerics.Generic_Complex_Elementary_Functions, when 
  4509.  Real'Signed_Zeros is True. See G.1.2(45). 
  4510.  The signs of zero values are as recommended by the relevant implementation 
  4511.  advice. 
  4512.  
  4513.  121.  Whether the strict mode or the relaxed mode is the default. See G.2(2). 
  4514.  The strict mode is the default. There is no separate relaxed mode. GNAT 
  4515.  provides a highly efficient implementation of strict mode. 
  4516.  
  4517.  122.  The result interval in certain cases of fixed-to-float conversion. See 
  4518.  G.2.1(10). 
  4519.  For cases where the result interval is implementation dependent, the accuracy 
  4520.  is that provided by performing all operations in 64-bit IEEE floating-point 
  4521.  format. 
  4522.  
  4523.  123.  The result of a floating point arithmetic operation in overflow 
  4524.  situations, when the Machine_Overflows attribute of the result type is False. 
  4525.  See G.2.1(13). 
  4526.  Infinite and Nan values are produced as dictated by the IEEE floating-point 
  4527.  standard. 
  4528.  
  4529.  124.  The result interval for division (or exponentiation by a negative 
  4530.  exponent), when the floating point hardware implements division as 
  4531.  multiplication by a reciprocal. See G.2.1(16). 
  4532.  Not relevant, division is IEEE exact. 
  4533.  
  4534.  125.  The definition of close result set, which determines the accuracy of 
  4535.  certain fixed point multiplications and divisions. See G.2.3(5). 
  4536.  Operations in the close result set are performed using IEEE long format 
  4537.  floating-point arithmetic. The input operands are converted to floating-point, 
  4538.  the operation is done in floating-point, and the result is converted to the 
  4539.  target type. 
  4540.  
  4541.  126.  Conditions on a universal_real operand of a fixed point multiplication 
  4542.  or division for which the result shall be in the perfect result set. See 
  4543.  G.2.3(22). 
  4544.  The result is only defined to be in the perfect result set if the result can 
  4545.  be computed by a single scaling operation involving a scale factor 
  4546.  representable in 64-bits. 
  4547.  
  4548.  127.  The result of a fixed point arithmetic operation in overflow situations, 
  4549.  when the Machine_Overflows attribute of the result type is False. See 
  4550.  G.2.3(27). 
  4551.  Not relevant, Machine_Overflows is True for fixed-point types. 
  4552.  
  4553.  128.  The result of an elementary function reference in overflow situations, 
  4554.  when the Machine_Overflows attribute of the result type is False. See 
  4555.  G.2.4(4). 
  4556.  IEEE infinite and Nan values are produced as appropriate. 
  4557.  
  4558.  129.  The value of the angle threshold, within which certain elementary 
  4559.  functions, complex arithmetic operations, and complex elementary functions 
  4560.  yield results conforming to a maximum relative error bound. See G.2.4(10). 
  4561.  Information on this subject is not yet available. 
  4562.  
  4563.  130.  The accuracy of certain elementary functions for parameters beyond the 
  4564.  angle threshold. See G.2.4(10). 
  4565.  Information on this subject is not yet available. 
  4566.  
  4567.  131.  The result of a complex arithmetic operation or complex elementary 
  4568.  function reference in overflow situations, when the Machine_Overflows 
  4569.  attribute of the corresponding real type is False. See G.2.6(5). 
  4570.  IEEE infinite and Nan values are produced as appropriate. 
  4571.  
  4572.  132.  The accuracy of certain complex arithmetic operations and certain 
  4573.  complex elementary functions for parameters (or components thereof) beyond the 
  4574.  angle threshold. See G.2.6(8). 
  4575.  Information on those subjects is not yet available. 
  4576.  
  4577.  133.  Information regarding bounded errors and erroneous execution. See 
  4578.  H.2(1). 
  4579.  Information on this subject is not yet available. 
  4580.  
  4581.  134.  Implementation-defined aspects of pragma Inspection_Point. See H.3.2(8). 
  4582.  Pragma Inspection_Point ensures that the variable is live and can be examined 
  4583.  by the debugger at the inspection point. 
  4584.  
  4585.  135.  Implementation-defined aspects of pragma Restrictions. See H.4(25). 
  4586.  There are no implementation-defined aspects of pragma Restrictions. The use of 
  4587.  pragma Restrictions [No_Exceptions] has no effect on the generated code. 
  4588.  Checks must suppressed by use of pragma Suppress. 
  4589.  
  4590.  136.  Any restrictions on pragma Restrictions. See H.4(27). 
  4591.  There are no restrictions on pragma Restrictions. 
  4592.  
  4593.  
  4594. ΓòÉΓòÉΓòÉ 8. Representation Clauses and Pragmas ΓòÉΓòÉΓòÉ
  4595.  
  4596.  Alignment Clauses             Alignment Clauses 
  4597.  Size Clauses                  Size Clauses 
  4598.  Biased Representation         Biased Representation 
  4599.  Value_Size and Object_Size ClausesValue_Size and Object_Size Clauses 
  4600.  Component_Size Clauses        Component_Size Clauses 
  4601.  Bit_Order Clauses             Bit_Order Clauses 
  4602.  Pragma Pack for Arrays        Pragma Pack for Arrays 
  4603.  Pragma Pack for Records       Pragma Pack for Records 
  4604.  Record Representation Clauses Record Representation Clauses 
  4605.  Enumeration Clauses           Enumeration Clauses 
  4606.  Address Clauses               Address Clauses 
  4607.  Effect of Convention on RepresentationEffect of Convention on Representation 
  4608.  Determining the Representations chosen by GNATDetermining the Representations 
  4609.                                chosen by GNAT 
  4610.  
  4611.  This section describes the representation clauses accepted by GNAT, and their 
  4612.  effect on the representation of corresponding data objects. 
  4613.  
  4614.  GNAT fully implements Annex C (Systems Programming). This means that all the 
  4615.  implementation advice sections in chapter 13 are fully implemented. However, 
  4616.  these sections only require a mininal level of support for representation 
  4617.  clauses. GNAT provides much more extensive capabilities, and this section 
  4618.  describes the additional capabilities provided. 
  4619.  
  4620.  
  4621. ΓòÉΓòÉΓòÉ 8.1. Alignment Clauses ΓòÉΓòÉΓòÉ
  4622.  
  4623.  
  4624.  GNAT requires that all alignment clauses specify a power of 2, and all default 
  4625.  alignments are always a power of 2. The default alignment values are as 
  4626.  follows: 
  4627.  
  4628.      Primitive Types 
  4629.       For primitive types, the alignment is the maximum of the actual size of 
  4630.       objects of the type, and the maximum alignment supported by the target. 
  4631.       For example, for type Long_Float, the object size is 8 bytes, and the 
  4632.       default alignment will be 8 on any target that supports alignments this 
  4633.       large, but on some targets, the maximum alignment may be smaller than 8, 
  4634.       in which case objects of type Long_Float will be maximally aligned. 
  4635.  
  4636.      Arrays 
  4637.       For arrays, the alignment is equal to the alignment of the component type 
  4638.       for the normal case where no packing or component size is given. If the 
  4639.       array is packed, and the packing is effective (see separate section on 
  4640.       packed arrays), then the alignment will be one for long packed arrays, or 
  4641.       arrays whose length is not known at compile time. For short packed 
  4642.       arrays, which are handled internally as modular types, the alignment will 
  4643.       be as described for primitive types, e.g. a packed array of length 31 
  4644.       bits will have an object size of four bytes, and an alignment of 4. 
  4645.  
  4646.      Records 
  4647.       For the normal non-packed case, the alignment of a record is equal to the 
  4648.       maximum alignment of any of its components. For tagged records, this 
  4649.       includes the implicit access type used for the tag. If a pragma Pack is 
  4650.       used and all fields are packable (see separate section on pragma Pack), 
  4651.       then the resulting alignment is 1. 
  4652.  
  4653.  An alignment clause may always specify a larger alignment than the default 
  4654.  value, up to some maximum value dependent on the target (obtainable by using 
  4655.  the attribute reference System'Maximum_Alignment). The only case in which it 
  4656.  is permissible to specify a smaller alignment than the default value is in the 
  4657.  case of a record for which a record representation clause is given. In this 
  4658.  case, packable fields for which a component clause is given still result in a 
  4659.  default alignment corresponding to the original type, but this may be 
  4660.  overridden, since these components in fact only require an alignment of one 
  4661.  byte. For example, given 
  4662.  
  4663.                        type v is record
  4664.                          a : integer;
  4665.                        end record;
  4666.                        for v use record
  4667.                          a at 0  range 0 ┬╖┬╖ 31;
  4668.                        end record;
  4669.                        for v'alignment use 1;
  4670.  
  4671.  The default alignment for the type v is 4, as a result of the integer field in 
  4672.  the record, but since this field is placed with a component clause, it is 
  4673.  permissible, as shown, to override the default alignment of the record to a 
  4674.  smaller value. 
  4675.  
  4676.  
  4677. ΓòÉΓòÉΓòÉ 8.2. Size Clauses ΓòÉΓòÉΓòÉ
  4678.  
  4679.  
  4680.  The default size of types is as specified in the reference manual. For 
  4681.  objects, GNAT will generally increase the type size so that the object size is 
  4682.  a multiple of storage units, and also a multiple of the alignment. For example 
  4683.  
  4684.                         type Smallint is range 1 ┬╖┬╖ 6;
  4685.                         type Rec is record
  4686.                          y1 : integer;
  4687.                          y2 : boolean;
  4688.                         end record;
  4689.  
  4690.  In this example, Smallint has a size of 3, as specified by the RM rules, but 
  4691.  objects of this type will have a size of 8, since objects by default occupy an 
  4692.  integral number of storage units. On some targets, notably older versions of 
  4693.  the Digital Alpha, the size of stand alone objects of this type may be 32, 
  4694.  reflecting the inability of the hardware to do byte load/stores. 
  4695.  
  4696.  Similarly, the size of type Rec is 40 bits, but the alignment is 4, so objects 
  4697.  of this type will have their size increased to 64 bits so that it is a 
  4698.  multiple of the alignment. The reason for this decision, which is in 
  4699.  accordance with the specific note in RM 13.3(43): 
  4700.  
  4701.                       A Size clause should be supported for an object if the specified
  4702.                       Size is at least as large as its subtype's Size, and corresponds
  4703.                       to a size in storage elements that is a multiple of the object's
  4704.                       Alignment (if the Alignment is nonzero).
  4705.  
  4706.  An explicit size clause may be used to override the default size by increasing 
  4707.  it. For example, if we have: 
  4708.  
  4709.                         type My_Boolean is new Boolean;
  4710.                         for My_Boolean'Size use 32;
  4711.  
  4712.  then objects of this type will always be 32 bits long. In the case of discrete 
  4713.  types, the size can be increased up to 64 bits, with the effect that the 
  4714.  entire specified field is used to hold the value, sign- or zero-extended as 
  4715.  appropriate. If more than 64 bits is specified, then padding space is 
  4716.  allocated after the value, and a warning is issued that there are unused bits. 
  4717.  
  4718.  Similarly the size of records and arrays may be increased, and the effect is 
  4719.  to add padding bits after the value. This also causes a warning message to be 
  4720.  generated. 
  4721.  
  4722.  
  4723. ΓòÉΓòÉΓòÉ 8.3. Biased Representation ΓòÉΓòÉΓòÉ
  4724.  
  4725.  
  4726.  In the case of scalars with a range starting at other than zero, it is 
  4727.  possible in some cases to specify a size smaller than the default minimum 
  4728.  value, and in such cases, GNAT uses an unsigned biased representation, in 
  4729.  which zero is used to represent the lower bound, and successive values 
  4730.  represent successive values of the type. 
  4731.  
  4732.  For example, suppose we have the declaration: 
  4733.  
  4734.                         type Small is range -7 ┬╖┬╖ -4;
  4735.                         for Small'Size use 2;
  4736.  
  4737.  Although the default size of type Small is 4, the Size clause is accepted by 
  4738.  GNAT and results in the following representation scheme: 
  4739.  
  4740.                        -7 is represented as 2#00#
  4741.                        -6 is represented as 2#01#
  4742.                        -5 is represented as 2#10#
  4743.                        -4 is represented as 2#11#
  4744.  
  4745.  Biased representation is only used if the specified Size clause cannot be 
  4746.  accepted in any other manner. These reduced sizes that force biased 
  4747.  representation can be used for all discrete types except for enumeration types 
  4748.  for which a representation clause is given. 
  4749.  
  4750.  
  4751. ΓòÉΓòÉΓòÉ 8.4. Value_Size and Object_Size Clauses ΓòÉΓòÉΓòÉ
  4752.  
  4753.  
  4754.  In Ada 95, the Size of a discrete type is the minimum number of bits required 
  4755.  to hold values of the type. Although this interpretation was allowed in Ada 
  4756.  83, it was not required, and this requirement in practice can cause some 
  4757.  significant difficulties. For example, in most Ada 83 compilers, Natural'Size 
  4758.  was 32. However, in Ada-95, Natural'Size is typically 31. This means that code 
  4759.  may change in behavior when moving from Ada 83 to Ada 95. For example, 
  4760.  consider: 
  4761.  
  4762.                         type Rec is record;
  4763.                          A : Natural;
  4764.                          B : Natural;
  4765.                         end record;
  4766.                         for Rec use record
  4767.                          for A use at 0  range 0 ┬╖┬╖ Natural'Size - 1;
  4768.                          for B use at 0  range Natural'Size ┬╖┬╖ 2 * Natural'Size - 1;
  4769.                         end record;
  4770.  
  4771.  In the above code, since the typical size of Natural objects is 32 bits and 
  4772.  Natural'Size is 31, the above code can cause unexpected inefficient packing in 
  4773.  Ada 95, and in general there are surprising cases where the fact that the 
  4774.  object size can exceed the size of the type causes suprises. 
  4775.  
  4776.  To help get around this problem GNAT provides two implementation dependent 
  4777.  attributes Value_Size and Object_Size. When applied to a type, these 
  4778.  attributes yield the size of the type (corresponding to the RM defined size 
  4779.  attribute), and the size of objects of the type respectively. 
  4780.  
  4781.  The Object_Size is used for determining the default size of objects and 
  4782.  components. This size value can be referred to using the Object_Size 
  4783.  attribute. The phrase "is used" here means that it is the basis of the 
  4784.  determination of the size. The backend is free to pad this up if necessary for 
  4785.  efficiency, e.g. an 8-bit stand-alone character might be stored in 32 bits on 
  4786.  a machine with no efficient byte access instructions such as the Alpha. 
  4787.  
  4788.  The default rules for the value of Object_Size for fixed-point and discrete 
  4789.  types are as follows: 
  4790.  
  4791.      The Object_Size for base subtypes reflect the natural hardware size in 
  4792.       bits (run the utility gnatpsta to find those values for numeric types). 
  4793.       Enumeration types and fixed-point base subtypes have 8. 16. 32 or 64 bits 
  4794.       for this size, depending on the range of values to be stored. 
  4795.  
  4796.      The Object_Size of a subtype is the same as the Object_Size of the type 
  4797.       from which it is obtained. 
  4798.  
  4799.      The Object_Size of a derived base type is copied from the parent base 
  4800.       type, and the Object_Size of a derived first subtype is copied from the 
  4801.       parent first subtype. 
  4802.  
  4803.  The Value_Size attribute is the number of bits required to store a value of 
  4804.  the type. This size can be referred to using the Value_Size attribute. This 
  4805.  value is used to determine how tightly to pack records or arrays with 
  4806.  components of this type, and also affects the semantics of unchecked 
  4807.  conversion (unchecked conversions where the Value_Size values differ generate 
  4808.  a warning, and are potentially target dependent). 
  4809.  
  4810.  The default rules for the value of Value_Size are as follows: 
  4811.  
  4812.      The Value_Size for a base subtype is the minimum number of bits required 
  4813.       to store all values of the type (including the sign bit only if negative 
  4814.       values are possible). 
  4815.  
  4816.      If a subtype statically matches the first subtype of a given type, then 
  4817.       it has by default the same Value_Size as the first subtype. This is a 
  4818.       consequence of RM 13.1(14) ("if two subtypes statically match, then their 
  4819.       subtype-specific aspects are the same".) 
  4820.  
  4821.      All other subtypes have a Value_Size corresponding to the minimum number 
  4822.       of bits required to store all values of the subtype. For dynamic bounds, 
  4823.       it is assumed that the value can range down or up to the corresponding 
  4824.       bound of the ancestor 
  4825.  
  4826.  The RM defined attribute Size corresponds to the Value_Size attribute. 
  4827.  
  4828.  The Size attribute may be defined for a first-named subtype. This sets the 
  4829.  Value_Size of the first-named subtype to the given value, and the Object_Size 
  4830.  of this first-named subtype to the given value padded up to an appropriate 
  4831.  boundary. It is a consequence of the default rules above that this Object_Size 
  4832.  will apply to all further subtypes. On the other hand, Value_Size is affected 
  4833.  only for the first subtype, any dynamic subtypes obtained from it directly, 
  4834.  and any statically matching subtypes. The Value_Size of any other static 
  4835.  subtypes is not affected. 
  4836.  
  4837.  Value_Size and Object_Size may be explicitly set for any subtype using an 
  4838.  attribute definition clause. Note that the use of these attributes can cause 
  4839.  the RM 13.1(14) rule to be violated. If two access types reference aliased 
  4840.  objects whose subtypes have differing Object_Size values as a result of 
  4841.  explicit attribute definition clauses, then it is erroneous to convert from 
  4842.  one access subtype to the other. 
  4843.  
  4844.  At the implementation level, Esize stores the Object_SIze and the RM_Size 
  4845.  field stores the Value_Size (and hence the value of the Size attribute, which, 
  4846.  as noted above, is equivalent to Value_Size). 
  4847.  
  4848.  To get a feel for the difference, consider the following examples (note that 
  4849.  in each case the base is short_short_integer with a size of 8): 
  4850.  
  4851.                                           Object_Size   Value_Size
  4852.                       type x1 is range 0┬╖┬╖5;            8        3
  4853.                       type x2 is range 0┬╖┬╖5;
  4854.                       for x2'size use 12;             12        12
  4855.                       subtype x3 is x2 range 0 ┬╖┬╖ 3;       12        2
  4856.                       subtype x4 is x2'base range 0 ┬╖┬╖ 10;     8        4
  4857.                       subtype x5 is x2 range 0 ┬╖┬╖ dynamic;    12        (7)
  4858.                       subtype x6 is x2'base range 0 ┬╖┬╖ dynamic;  8        (7)
  4859.  
  4860.  Note: the entries marked (7) are not actually specified by the Ada 95 RM, but 
  4861.  it seems in the spirit of the RM rules to allocate the minimum number of bits 
  4862.  known to be large enough to hold the given range of values. 
  4863.  
  4864.  So far, so good, but GNAT has to obey the RM rules, so the question is under 
  4865.  what conditions must the RM Size be used. The following is a list of the 
  4866.  occasions on which the RM Size must be used: 
  4867.  
  4868.      Component size for packed arrays or records 
  4869.  
  4870.      Value of the attribute Size for a type 
  4871.  
  4872.      Warning about sizes not matching for unchecked conversion 
  4873.  
  4874.  For types other than discrete and fixed-point types, the Object_Size and 
  4875.  Value_Size are the same (and equivalent to the RM attribute Size). Only Size 
  4876.  may be specified for such types. 
  4877.  
  4878.  
  4879. ΓòÉΓòÉΓòÉ 8.5. Component_Size Clauses ΓòÉΓòÉΓòÉ
  4880.  
  4881.  
  4882.  Normally, the value specified in a component clause must be consistent with 
  4883.  the subtype of the array component with regard to size and alignment. In other 
  4884.  words, the value specified must be at least equal to the size of this subtype, 
  4885.  and must be a multiple of the alignment value. 
  4886.  
  4887.  In addition, component size clauses are allowed which cause the array to be 
  4888.  packed, by specifying a smaller value. The cases in which this is allowed are 
  4889.  for component size values in the range 1-63. The value specified must not be 
  4890.  smaller than the Size of the subtype. GNAT will accurately honor all packing 
  4891.  requests in this range. For example, if we have: 
  4892.  
  4893.                       type r is array (1 ┬╖┬╖ 8) of Natural;
  4894.                       for r'Size use 31;
  4895.  
  4896.  then the resulting array has a length of 31 bytes (248 bits = 8 * 31). Of 
  4897.  course access to the components of such an array is considerably less 
  4898.  efficient than if the natural component size of 32 is used. 
  4899.  
  4900.  
  4901. ΓòÉΓòÉΓòÉ 8.6. Bit_Order Clauses ΓòÉΓòÉΓòÉ
  4902.  
  4903.  
  4904.  For record subtypes, GNAT permits the specification of the Bit_Order 
  4905.  attribute. The specification may either correspond to the default bit order 
  4906.  for the target, in which case the specification has no effect and places no 
  4907.  additional restrictions, or it may be for the non-standard setting (that is 
  4908.  the opposite of the default). 
  4909.  
  4910.  In the case where the non-standard value is specified, the effect is to 
  4911.  renumber bits within each bit, but the ordering of bytes is not affected. 
  4912.  There are certain restrictions placed on component clauses as follows: 
  4913.  
  4914.      Components fitting within a single storage unit. 
  4915.  
  4916.       These are unrestricted, and the effect is merely to renumber bits. For 
  4917.       example if we are on a little-endian machine with Low_Order_First being 
  4918.       the default, then the following two declarations have exactly the same 
  4919.       effect: 
  4920.  
  4921.                         type R1 is record
  4922.                          A : Boolean;
  4923.                          B : Integer range 1 ┬╖┬╖ 120;
  4924.                         end record;
  4925.                         for R1 use record
  4926.                          A at 0 range 0 ┬╖┬╖ 0;
  4927.                          B at 0 range 1 ┬╖┬╖ 7;
  4928.                         end record;
  4929.                         type R2 is record
  4930.                          A : Boolean;
  4931.                          B : Boolean;
  4932.                         end record;
  4933.                         for R2'Bit_Order use High_Order_First;
  4934.                         for R1 use record
  4935.                          A at 0 range 7 ┬╖┬╖ 7;
  4936.                          B at 0 range 0 ┬╖┬╖ 6;
  4937.                         end record;
  4938.  
  4939.  The useful application here is to write the second declaration with the 
  4940.  Bit_Order attribute definition clause, and know that it will be treated the 
  4941.  same, regardless of whether the target is little-endian or big-endian. 
  4942.  
  4943.      Components occuping an integral number of bytes 
  4944.  
  4945.       These are components that exactly fit in two or more bytes. Such 
  4946.       component declarations are allowed, but have no effect, since it is 
  4947.       important to realize that the Bit_Order specification does not affect the 
  4948.       ordering of bytes. In particular, the following attempt at getting an 
  4949.       endian-indepedent integer does not work: 
  4950.  
  4951.                         type R2 is record
  4952.                          A : Integer;
  4953.                         end record;
  4954.                         for R2'Bit_Order use High_Order_First;
  4955.                         for R1 use record
  4956.                          A at 0 range 0 ┬╖┬╖ 31;
  4957.                         end record;
  4958.  
  4959.  This declaration will result in a little-endian integer on a little-endian 
  4960.  machine, and a big-endian integer on a big-endian machine. if byte flipping is 
  4961.  required for interoperability between big- and little-endian machines, this 
  4962.  must be explicitly programmed. This capability is not provided by Bit_Order. 
  4963.  
  4964.      Components that are positioned across byte boundaries 
  4965.  
  4966.       but do not occupy an integral number of bytes. Given that bytes are not 
  4967.       reordered, such fields would occupny a non-contiguous sequence of bits in 
  4968.       memory, requiring non-trivial code to reassemble. They are for this 
  4969.       reason not permitted, and any component clause specifying such a layout 
  4970.       will be flagged as illegal by GNAT. 
  4971.  
  4972.  Since the misconception that Bit_Order automatically deals with all 
  4973.  endian-related incompatibilities is a common one, the specification of a 
  4974.  component field that is an integral number of bytes will always generate a 
  4975.  warning This warning may be suppressed using pragma Suppress if desired. 
  4976.  
  4977.  
  4978. ΓòÉΓòÉΓòÉ 8.7. Pragma Pack for Arrays ΓòÉΓòÉΓòÉ
  4979.  
  4980.  
  4981.  Pragma Pack applied to an array has no effect unless the component type is 
  4982.  packable. For a component type to be packable, it must be one of the following 
  4983.  cases: 
  4984.  
  4985.      Any scalar type 
  4986.  
  4987.      Any fixed-point type 
  4988.  
  4989.      Any type whose size is specified with a size clause 
  4990.  
  4991.      Any packed array type with a static size 
  4992.  
  4993.  For all these cases, if the component subtype size is in the range 1- 63, then 
  4994.  the effect of the pragma Pack is exactly as though a component size were 
  4995.  specified giving the component subtype size. For example if we have: 
  4996.  
  4997.                         type r is range 0 ┬╖┬╖ 17;
  4998.  
  4999.                         type ar is array (1 ┬╖┬╖ 8) of r;
  5000.                         pragma Pack (ar);
  5001.  
  5002.  Then the component size of ar will be set to 5 (i.e. to r'size, and the size 
  5003.  of the array ar will be exactly 40 bits. 
  5004.  
  5005.  Note that in some cases this rather fierce approach to packing can produce 
  5006.  unexpected effects. For example, in Ada 95, type Natural typically has a size 
  5007.  of 31, meaning that if you pack an array of Natural, you get 31-bit close 
  5008.  packing, which saves a few bits, but results in far less efficient access. 
  5009.  Since many other Ada compilers will ignore such a packing request, GNAT will 
  5010.  generate a warning on some uses of pragma Pack that it guesses might not be 
  5011.  what is intended. You can easily remove this warning by using an explicit 
  5012.  Component_Size setting instead, which never generates a warning, since the 
  5013.  intention of the programmer is clear in this case. 
  5014.  
  5015.  GNAT treats packed arrays in one of two ways. If the size of the array is 
  5016.  known at compile time and is less than 64 bits, then internally the array is 
  5017.  represented as a single modular type, of exactly the appropriate number of 
  5018.  bits. If the length is greater than 63 bits, or is not known at compile time, 
  5019.  then the packed array is represented as an array of bytes, and the length is 
  5020.  always a multiple of 8 bits. 
  5021.  
  5022.  
  5023. ΓòÉΓòÉΓòÉ 8.8. Pragma Pack for Records ΓòÉΓòÉΓòÉ
  5024.  
  5025.  
  5026.  Pragma Pack applied to a record will pack the components to reduce wasted 
  5027.  space from alignment gaps and by reducing the amount of space taken by 
  5028.  components. We distinguish between package components and non-packable 
  5029.  components. Components of the following types are considered packable: 
  5030.  
  5031.      All scalar types are packable. 
  5032.  
  5033.      All fixed-point types are represented internally as integers, and are 
  5034.       packable. 
  5035.  
  5036.      Small packed arrays, whose size does not exceed 64 bits, and where the 
  5037.       size is statically known at compile time, are represented internally as 
  5038.       modular integers, and so they are also packable. 
  5039.  
  5040.  All packable components occupy the exact number of bits corresponding to their 
  5041.  Size value, and are packed with no padding bits, i.e. they can start on an 
  5042.  arbitrary bit boundary. 
  5043.  
  5044.  All other types are non-packable, they occupy an integral number of storage 
  5045.  units, and are placed at a boundary corresponding to their alignment 
  5046.  requirements. 
  5047.  
  5048.  For example, consider the record 
  5049.  
  5050.                         type Rb1 is array (1 ┬╖┬╖ 13) of Boolean;
  5051.                         pragma Pack (rb1);
  5052.                         type Rb2 is array (1 ┬╖┬╖ 65) of Boolean;
  5053.                         pragma Pack (rb2);
  5054.                         type x2 is record
  5055.                          l1 : Boolean;
  5056.                          l2 : Duration;
  5057.                          l3 : Float;
  5058.                          l4 : Boolean;
  5059.                          l5 : Rb1;
  5060.                          l6 : Rb2;
  5061.                         end record;
  5062.                         pragma Pack (x2);
  5063.  
  5064.  The representation for the record x2 is as follows: 
  5065.  
  5066.                       for x2'Size use 224;
  5067.                       for x2 use record
  5068.                         l1 at  0 range  0 ┬╖┬╖  0;
  5069.                         l2 at  0 range  1 ┬╖┬╖ 64;
  5070.                         l3 at 12 range  0 ┬╖┬╖ 31;
  5071.                         l4 at 16 range  0 ┬╖┬╖  0;
  5072.                         l5 at 16 range  1 ┬╖┬╖ 13;
  5073.                         l6 at 18 range  0 ┬╖┬╖ 71;
  5074.                       end record;
  5075.  
  5076.  Studying this example, we see that the packable fields l1 and l2 are of length 
  5077.  equal to their sizes, and placed at specific bit boundaries (and not byte 
  5078.  boundaries) to eliminate padding. But l3 is of a non-packable float type, so 
  5079.  it is on the next appropriate alignment boundary. 
  5080.  
  5081.  The next two fields are fully packable, so l4 and l5 are minimally packed with 
  5082.  no gaps. However, type Rb2 is a packed array that is longer than 64 bits, so 
  5083.  it is itself non-packable. Thus the l6 field is aligned to the next byte 
  5084.  boundary, and takes an integral number of bytes, i.e. 72 bits. 
  5085.  
  5086.  
  5087. ΓòÉΓòÉΓòÉ 8.9. Record Representation Clauses ΓòÉΓòÉΓòÉ
  5088.  
  5089.  
  5090.  Record representation clauses may be given for all record types, including 
  5091.  types obtained by record extension. Component clauses are allowed for any 
  5092.  static component. The restrictions on component clauses depend on the type of 
  5093.  the component. 
  5094.  
  5095.  For all components of an elementary type, the only restriction on component 
  5096.  clauses is that the size must be at least the 'Size value of the type 
  5097.  (actually the Value_Size). There are no restrictions due to alignment, and 
  5098.  such components may freely cross storage boundaries. 
  5099.  
  5100.  Packed arrays with a size up to and including 64-bits are represented 
  5101.  internally using a modular type with the appropriate number of bits, and thus 
  5102.  the same lack of restriction applies. For example, if you declare: 
  5103.  
  5104.                         type R is array (1 ┬╖┬╖ 49) of Boolean;
  5105.                         pragma Pack (R);
  5106.                         for R'Size use 49;
  5107.  
  5108.  then a component clause for a component of type R may start on any specified 
  5109.  bit boundary, and may specify a value of 49 bits or greater. 
  5110.  
  5111.  For non-primitive types, including packed arrays with a size greater than 
  5112.  64-bits, component clauses must respect the alignment requirement of the type, 
  5113.  in particular, always starting on a byte boundary, and the length must be a 
  5114.  multiple of the storage unit. 
  5115.  
  5116.  The tag field of a tagged type always occupies an address sized field at the 
  5117.  start of the record. No component clause may attempt to overlay this tag. 
  5118.  
  5119.  In the case of a record extension T1, of a type T, no component clause applied 
  5120.  to the type T1 can specify a storage location that would overlap the first 
  5121.  T'Size bytes of the record. 
  5122.  
  5123.  
  5124. ΓòÉΓòÉΓòÉ 8.10. Enumeration Clauses ΓòÉΓòÉΓòÉ
  5125.  
  5126.  The only restriction on enumeration clauses is that the range of values must 
  5127.  be representable. For the signed case, if one or more of the representation 
  5128.  values are negative, all values must be in the range: 
  5129.  
  5130.                         System.Min_Int ┬╖┬╖ System.Max_Int
  5131.  
  5132.  For the unsigned case, where all values are non negative, the values must be 
  5133.  in the range: 
  5134.  
  5135.                         0 ┬╖┬╖ System.Max_Binary_Modulus;
  5136.  
  5137.  A "confirming" representation clause is one in which the values range from 0 
  5138.  in sequence, i.e. a clause that confirms the default representation for an 
  5139.  enumeration type. Such a confirming representation is permitted by these 
  5140.  rules, and is specially recognized by the compiler so that no extra overhead 
  5141.  results from the use of such a clause. 
  5142.  
  5143.  If an array has an index type which is an enumeration type to which an 
  5144.  enumeration clause has been applied, then the array is stored in a compact 
  5145.  manner. Consider the declarations: 
  5146.  
  5147.                         type r is (A, B, C);
  5148.                         for r use (A => 1, B => 5, C => 10);
  5149.                         type t is array (r) of Character;
  5150.  
  5151.  The array type t corresponds to a vector with exactly three elements and has a 
  5152.  default size equal to 3*Character'Size. This ensures efficient use of space, 
  5153.  but means that accesses to elements of the array will incur the overhead of 
  5154.  converting representation values to the corresponding positional values, (i.e. 
  5155.  the value delivered by the  Pos attribute). 
  5156.  
  5157.  
  5158. ΓòÉΓòÉΓòÉ 8.11. Address Clauses ΓòÉΓòÉΓòÉ
  5159.  
  5160.  The reference manual allows a general restriction on representation clauses, 
  5161.  as found in RM 13.1(22): 
  5162.  
  5163.                         An implementation need not support representation
  5164.                         items containing nonstatic expressions, except that
  5165.                         an implementation should support a representation item
  5166.                         for a given entity if each nonstatic expression in the
  5167.                         representation item is a name that statically denotes
  5168.                         a constant declared before the entity.
  5169.  
  5170.  In practice this is applicable only to address clauses, since this is the only 
  5171.  case in which a non-static expression is permitted by the syntax. As the AARM 
  5172.  notes in sections 13.1 (22.a-22.h): 
  5173.  
  5174.                        22.a  Reason: This is to avoid the following sort
  5175.                            of thing:
  5176.                        22.b     X : Integer := F(┬╖┬╖┬╖);
  5177.                              Y : Address := G(┬╖┬╖┬╖);
  5178.                              for X'Address use Y;
  5179.                        22.c  In the above, we have to evaluate the
  5180.                            initialization expression for X before we
  5181.                            know where to put the result. This seems
  5182.                            like an unreasonable implementation burden.
  5183.                        22.d  The above code should instead be written
  5184.                            like this:
  5185.                        22.e     Y : constant Address := G(┬╖┬╖┬╖);
  5186.                              X : Integer := F(┬╖┬╖┬╖);
  5187.                              for X'Address use Y;
  5188.                        22.f  This allows the expression ``Y'' to be safely
  5189.                            evaluated before X is created.
  5190.                        22.g  The constant could be a formal parameter of mode in.
  5191.                        22.h  An implementation can support other nonstatic
  5192.                            expressions if it wants to. Expressions of type
  5193.                            Address are hardly ever static, but their value
  5194.                            might be known at compile time anyway in many
  5195.                            cases.
  5196.  
  5197.  GNAT does indeed permit many additional cases of non-static expressions. In 
  5198.  particular, if the type involved is elementary there are no restrictions 
  5199.  (since in this case, holding a temporary copy of the initialization value, if 
  5200.  one is present, is inexpensive). In addition, if there is no implicit or 
  5201.  explicit initialization, then there are no restrictions. GNAT will reject only 
  5202.  the case where all three of these conditions hold: 
  5203.  
  5204.      The type of the item is non-elementary (e.g. a record or array). 
  5205.  
  5206.      There is explicit or implicit initialization required for the object. 
  5207.  
  5208.      The address value is non-static. 
  5209.  
  5210.  As noted above in section 22.h, address values are typically non-static. In 
  5211.  particular the To_Address function, even if applied to a literal value, is a 
  5212.  non-static function call. To avoid this minor annoyance, GNAT provides the 
  5213.  implementation defined attribute 'To_Address. The following two expressions 
  5214.  have identical values: 
  5215.  
  5216.                         To_Address (16#1234_0000#)
  5217.                         System'To_Address (16#1234_0000#);
  5218.  
  5219.  except that the second form is considered to be a static expression, and thus 
  5220.  when used as an address clause value is always permitted. 
  5221.  
  5222.  An address clause cannot be given for an exported object. More understandably 
  5223.  the real restriction is that objects with an address clause cannot be 
  5224.  exported. This is because such variables are not defined by the Ada program, 
  5225.  so there is no external object so export. 
  5226.  
  5227.  It is permissible to give an address clause and a pragma Import for the same 
  5228.  object. In this case, the variable is not really defined by the Ada program, 
  5229.  so there is no external symbol to be linked. The link name and the external 
  5230.  name are ignored in this case. The reason that we allow this combination is 
  5231.  that it provides a useful idiom to avoid unwanted initializations on objects 
  5232.  with addres clauses. 
  5233.  
  5234.  When an address clause is given for an object that has implicit or explicit 
  5235.  initialization, then by default initialization takes place. This means that 
  5236.  the effect of the object declaration is to overwrite the memory at the 
  5237.  specified address. This is almost always not what the programmer wants, so 
  5238.  GNAT will output a warning: 
  5239.  
  5240.                        with System;
  5241.                        package G is
  5242.                          type R is record
  5243.                           M : Integer := 0;
  5244.                          end record;
  5245.  
  5246.                          Ext : R;
  5247.                          for Ext'Address use System'To_Address (16#1234_1234#);
  5248.                            |
  5249.                        >>> warning: implicit initialization of "Ext" may
  5250.                          modify overlaid storage
  5251.                        >>> warning: use pragma Import for "Ext" to suppress
  5252.                          initialization (RM B(24))
  5253.  
  5254.                        end G;
  5255.  
  5256.  As indicated by the warning message, the solution is to use a (dummy) pragma 
  5257.  Import to suppress this initialization. The pragma tell the compiler that the 
  5258.  object is declared and initialized elsewhere. The following package compiles 
  5259.  without warnings (and the initialization is suppressed): 
  5260.  
  5261.                         with System;
  5262.                         package G is
  5263.                          type R is record
  5264.                            M : Integer := 0;
  5265.                          end record;
  5266.  
  5267.                          Ext : R;
  5268.                          for Ext'Address use System'To_Address (16#1234_1234#);
  5269.                          pragma Import (Ada, Ext);
  5270.                         end G;
  5271.  
  5272.  
  5273. ΓòÉΓòÉΓòÉ 8.12. Effect of Convention on Representation ΓòÉΓòÉΓòÉ
  5274.  
  5275.  
  5276.  Normally the specification of a foreign language convention for a type or an 
  5277.  object has no effect on the chosen representation. In particular, the 
  5278.  representation chosen for data in GNAT generally meets the standard system 
  5279.  conventions, and for example records are laid out in a manner that is 
  5280.  consistent with C. This means that specifying convention C (for example) has 
  5281.  no effect. 
  5282.  
  5283.  There are three exceptions to this general rule: 
  5284.  
  5285.      Convention Fortran and array subtypes 
  5286.       If pragma Convention Fortran is specified for an array subtype, then in 
  5287.       accordance with the implementation advice in section 3.6.2(11) of the Ada 
  5288.       Reference Manual, the array will be stored in a Fortran-compatible 
  5289.       column-major manner, instead of the normal default row-major order. 
  5290.  
  5291.      Convention C and enumeration types 
  5292.       GNAT normally stores enumeration types in 8, 16, or 32 bits as required 
  5293.       to accomodate all values of the type. For example, for the enumeration 
  5294.       type declared by: 
  5295.  
  5296.                         type Color is (Red, Green, Blue);
  5297.  
  5298.  8 bits is sufficient to store all values of the type, so by default, objects 
  5299.  of type Color will be represented using 8 bits. However, normal C convention 
  5300.  is to use 32-bits for all enum values in C, since enum values are essentially 
  5301.  of type int. If pragma Convention C is specified for an Ada enumeration type, 
  5302.  then the size is modified as necessary (usually to 32 bits) to be consistent 
  5303.  with the C convention for enum values. 
  5304.  
  5305.      Convention C/Fortran and Boolean types 
  5306.       In C, the usual convention for boolean values, that is values used for 
  5307.       conditions, is that zero represents false, and non-zero values represent 
  5308.       true. In Ada, the normal convention is that two specific values, 
  5309.       typically 0/1, are used to represent false/true respectively. 
  5310.  
  5311.       Fortran has a similar convention for LOGICAL values (any non-zero value 
  5312.       represents true). 
  5313.  
  5314.       To accomodate the Fortran and C conventions, if a pragma Convention 
  5315.       specifies C or Fortran convention for a derived Boolean, as in the 
  5316.       following example: 
  5317.  
  5318.                         type C_Switch is new Boolean;
  5319.                         pragma Convention (C, C_Switch);
  5320.  
  5321.  then the GNAT generated code will treat any non-zero value as true. For truth 
  5322.  values generated by GNAT, the conventional value 1 will be used for True, but 
  5323.  when one of these values is read, any non-zero value is treated as True. 
  5324.  
  5325.  
  5326. ΓòÉΓòÉΓòÉ 8.13. Determining the Representations chosen by GNAT ΓòÉΓòÉΓòÉ
  5327.  
  5328.  
  5329.  Although the descriptions in this section are intended to be complete, it is 
  5330.  often easier to simply experiment to see what GNAT accepts and what the effect 
  5331.  is on the layout of types and objects. 
  5332.  
  5333.  As required by the Ada RM, if a representation clause is not accepted, then it 
  5334.  must be rejected as illegal by the compiler. However, when a representation 
  5335.  clause or pragma is accepted, there can still be questions of what the 
  5336.  compiler actually does. For example, if a partial record representation clause 
  5337.  specifies the location of some components and not others, then where are the 
  5338.  non-specified components placed? Or if pragma pack is used on a record, then 
  5339.  exactly where are the resulting fields placed? The section on pragma Pack in 
  5340.  this chapter can be used to answer the second question, but it is often easier 
  5341.  to just see what the compiler does. 
  5342.  
  5343.  For this purpose, GNAT provides the option -gnatR. If you compile with this 
  5344.  option, then the compiler will output information on the actual 
  5345.  representations chosen, in a format similar to source representation clauses. 
  5346.  For example, if we compile the package: 
  5347.  
  5348.                       package q is
  5349.                         type r (x : boolean) is tagged record
  5350.                          case x is
  5351.                            when True => S : String (1 ┬╖┬╖ 100);
  5352.                            when False => null;
  5353.                          end case;
  5354.                         end record;
  5355.                         type r2 is new r (false) with record
  5356.                          y2 : integer;
  5357.                         end record;
  5358.                         for r2 use record
  5359.                          y2 at 16 range 0 ┬╖┬╖ 31;
  5360.                         end record;
  5361.                         type x is record
  5362.                          y : character;
  5363.                         end record;
  5364.                         type x1 is array (1 ┬╖┬╖ 10) of x;
  5365.                         for x1'component_size use 11;
  5366.                         type ia is access integer;
  5367.                         type Rb1 is array (1 ┬╖┬╖ 13) of Boolean;
  5368.                         pragma Pack (rb1);
  5369.                         type Rb2 is array (1 ┬╖┬╖ 65) of Boolean;
  5370.                         pragma Pack (rb2);
  5371.                         type x2 is record
  5372.                          l1 : Boolean;
  5373.                          l2 : Duration;
  5374.                          l3 : Float;
  5375.                          l4 : Boolean;
  5376.                          l5 : Rb1;
  5377.                          l6 : Rb2;
  5378.                         end record;
  5379.                         pragma Pack (x2);
  5380.                       end q;
  5381.  
  5382.  using the switch -gnatR we obtain the following output: 
  5383.  
  5384.                       Representation information for unit q
  5385.                       -------------------------------------
  5386.                       for r'Size use ??;
  5387.                       for r'Alignment use 4;
  5388.                       for r use record
  5389.                         x   at 4 range  0 ┬╖┬╖  7;
  5390.                         _tag at 0 range  0 ┬╖┬╖ 31;
  5391.                         s   at 5 range  0 ┬╖┬╖ 799;
  5392.                       end record;
  5393.                       for r2'Size use 160;
  5394.                       for r2'Alignment use 4;
  5395.                       for r2 use record
  5396.                         x    at  4 range  0 ┬╖┬╖  7;
  5397.                         _tag   at  0 range  0 ┬╖┬╖ 31;
  5398.                         _parent at  0 range  0 ┬╖┬╖ 63;
  5399.                         y2    at 16 range  0 ┬╖┬╖ 31;
  5400.                       end record;
  5401.                       for x'Size use 8;
  5402.                       for x'Alignment use 1;
  5403.                       for x use record
  5404.                         y at 0 range  0 ┬╖┬╖  7;
  5405.                       end record;
  5406.                       for x1'Size use 112;
  5407.                       for x1'Alignment use 1;
  5408.                       for x1'Component_Size use 11;
  5409.                       for rb1'Size use 13;
  5410.                       for rb1'Alignment use 2;
  5411.                       for rb1'Component_Size use 1;
  5412.                       for rb2'Size use 72;
  5413.                       for rb2'Alignment use 1;
  5414.                       for rb2'Component_Size use 1;
  5415.                       for x2'Size use 224;
  5416.                       for x2'Alignment use 4;
  5417.                       for x2 use record
  5418.                         l1 at  0 range  0 ┬╖┬╖  0;
  5419.                         l2 at  0 range  1 ┬╖┬╖ 64;
  5420.                         l3 at 12 range  0 ┬╖┬╖ 31;
  5421.                         l4 at 16 range  0 ┬╖┬╖  0;
  5422.                         l5 at 16 range  1 ┬╖┬╖ 13;
  5423.                         l6 at 18 range  0 ┬╖┬╖ 71;
  5424.                       end record;
  5425.  
  5426.  The Size values are actually the Object_Size, i.e. the default size that will 
  5427.  be allocated for objects of the type. The ?? size for type r indicates that we 
  5428.  have a variant record, and the actual size of objects will depend on the 
  5429.  discriminant value. 
  5430.  
  5431.  The Alignment values show the actual alignment chosen by the compiler for each 
  5432.  record or array type. 
  5433.  
  5434.  The record representation clause for type r shows where all fields are placed, 
  5435.  including the compiler generated tag field (whose location cannot be 
  5436.  controlled by the programmer). 
  5437.  
  5438.  The record representation clause for the type extension r2 shows all the 
  5439.  fields present, including the parent field, which is a copy of the fields of 
  5440.  the parent type of r2, i.e. r1. 
  5441.  
  5442.  The component size and size clauses for types rb1 and rb2 show the exact 
  5443.  effect of pragma Pack on these arrays, and the record representation clause 
  5444.  for type x2 shows how pragma Pack affects this record type. 
  5445.  
  5446.  In some cases, it may be useful to cut and paste the representation clauses 
  5447.  generated by the compiler into the original source to fix and guarantee the 
  5448.  actual representation to be used. 
  5449.  
  5450.  
  5451. ΓòÉΓòÉΓòÉ 9. Standard Library Routines ΓòÉΓòÉΓòÉ
  5452.  
  5453.  
  5454.  The Ada 95 Reference Manual contains in Annex A a full description of an 
  5455.  extensive set of standard library routines that can be used in any Ada 
  5456.  program, and which must be provided by all Ada compilers. They are analogous 
  5457.  to the standard C library used by C programs. 
  5458.  
  5459.  GNAT implements all of the facilities described in annex A, and for most 
  5460.  purposes the description in the Ada 95 reference manual, or appropriate Ada 
  5461.  text book, will be sufficient for making use of these facilities. 
  5462.  
  5463.  In the case of the input-output facilities, See The Implementation of Standard 
  5464.  I/O, gives details on exactly how GNAT interfaces to the file system. For the 
  5465.  remaining packages, the Ada 95 reference manual should be sufficient. The 
  5466.  following is a list of the packages included, together with a brief 
  5467.  description of the functionality that is provided. 
  5468.  
  5469.  For completeness, references are included to other predefined library routines 
  5470.  defined in other sections of the Ada 95 reference manual (these are 
  5471.  cross-indexed from annex A). 
  5472.  
  5473.  Ada (A.2) 
  5474.            This is a parent package for all the standard library packages. It 
  5475.            is usually included implicitly in your program, and itself contains 
  5476.            no useful data or routines. 
  5477.  
  5478.  Ada.Calendar (9.6) 
  5479.            Calendar provides time of day access, and routines for manipulating 
  5480.            times and durations. 
  5481.  
  5482.  Ada.Characters (A.3.1) 
  5483.            This is a dummy parent package that contains no useful entities 
  5484.  
  5485.  Ada.Characters.Handling (A.3.2) 
  5486.            This package provides some basic character handling capabilities, 
  5487.            including classification functions for classes of characters (e.g. 
  5488.            test for letters, or digits). 
  5489.  
  5490.  Ada.Characters.Latin_1 (A.3.3) 
  5491.            This package includes a complete set of definitions of the 
  5492.            characters that appear in type CHARACTER. It is useful for writing 
  5493.            programs that will run in international environments. For example, 
  5494.            if you want an upper case E with an acute accent in a string, it is 
  5495.            often better to use the definition of UC_E_Acute in this package. 
  5496.            Then your program will print in an understandable manner even if 
  5497.            your environment does not support these extended characters. 
  5498.  
  5499.  Ada.Command_Line (A.15) 
  5500.            This package provides access to the command line parameters and the 
  5501.            name of the current program (analogous to the use of argc and argv 
  5502.            in C), and also allows the exit status for the program to be set in 
  5503.            a system-independent manner. 
  5504.  
  5505.  Ada.Decimal (F.2) 
  5506.            This package provides constants describing the range of decimal 
  5507.            numbers implemented, and also a decimal divide routine (analogous to 
  5508.            the COBOL verb DIVIDE ┬╖┬╖ GIVING ┬╖┬╖ REMAINDER ┬╖┬╖) 
  5509.  
  5510.  Ada.Direct_IO (A.8.4) 
  5511.            This package provides input-output using a model of a set of records 
  5512.            of fixed-length, containing an arbitrary definite Ada type, indexed 
  5513.            by an integer record number. 
  5514.  
  5515.  Ada.Dynamic_Priorities (D.5) 
  5516.            This package allows the priorities of a task to be adjusted 
  5517.            dynamically as the task is running. 
  5518.  
  5519.  Ada.Exceptions (11.4.1) 
  5520.            This package provides additional information on exceptions, and also 
  5521.            contains facilities for treating exceptions as data objects, and 
  5522.            raising exceptions with associated messages. 
  5523.  
  5524.  Ada.Finalization (7.6) 
  5525.            This package contains the declarations and subprograms to support 
  5526.            the use of controlled types, providing for automatic initialization 
  5527.            and finalization (analogous to the constructors and destructors of 
  5528.            C++) 
  5529.  
  5530.  Ada.Interrupts (C.3.2) 
  5531.            This package provides facilities for interfacing to interrupts, 
  5532.            which includes the set of signals or conditions that can be raised 
  5533.            and recognized as interrupts. 
  5534.  
  5535.  Ada.Interrupts.Names (C.3.2) 
  5536.            This package provides the set of interrupt names (actually signal or 
  5537.            condition names) that can be handled by GNAT. 
  5538.  
  5539.  Ada.IO_Exceptions (A.13) 
  5540.            This package defines the set of exceptions that can be raised by use 
  5541.            of the standard IO packages. 
  5542.  
  5543.  Ada.Numerics 
  5544.            This package contains some standard constants and exceptions used 
  5545.            throughout the numerics packages. Note that the constants pi and e 
  5546.            are defined here, and it is better to use these definitions than 
  5547.            rolling your own. 
  5548.  
  5549.  Ada.Numerics.Complex_Elementary_Functions 
  5550.            Provides the implementation of standard elementary functions (such 
  5551.            as log and trigonometric functions) operating on complex numbers 
  5552.            using the standard Float and the Complex and Imaginary types created 
  5553.            by the package Numerics.Complex_Types. 
  5554.  
  5555.  Ada.Numerics.Complex_Types 
  5556.            This is a predefined instantiation of Numerics.Generic_Complex_Types 
  5557.            using Standard.Float to build the type Complex and Imaginary. 
  5558.  
  5559.  Ada.Numerics.Discrete_Random 
  5560.            This package provides a random number generator suitable for 
  5561.            generating random integer values from a specified range. 
  5562.  
  5563.  Ada.Numerics.Float_Random 
  5564.            This package provides a random number generator suitable for 
  5565.            generating uniformly distributed floating point values. 
  5566.  
  5567.  Ada.Numerics.Generic_Complex_Elementary_Functions 
  5568.            This is a generic version of the package that provides the 
  5569.            implementation of standard elementary functions (such as log an 
  5570.            trigonometric functions) for an arbitrary complex type. 
  5571.  
  5572.            The following predefined instantiations of this package exist 
  5573.  
  5574.              Short_Float 
  5575.                          Ada.Numerics.Short_Complex_Elementary_Functions 
  5576.  
  5577.              Float 
  5578.                          Ada.Numerics.Complex_Elementary_Functions 
  5579.  
  5580.              Long_Float 
  5581.                          Ada.Numerics.  Long_Complex_Elementary_Functions 
  5582.  
  5583.  Ada.Numerics.Generic_Complex_Types 
  5584.            This is a generic package that allows the creation of complex types, 
  5585.            with associated complex arithmetic operations. 
  5586.  
  5587.            The following predefined instantiations of this package exist 
  5588.  
  5589.              Short_Float 
  5590.                          Ada.Numerics.Short_Complex_Complex_Types 
  5591.  
  5592.              Float 
  5593.                          Ada.Numerics.Complex_Complex_Types 
  5594.  
  5595.              Long_Float 
  5596.                          Ada.Numerics.Long_Complex_Complex_Types 
  5597.  
  5598.  Ada.Numerics.Generic_Elementary_Functions 
  5599.            This is a generic package that provides the implementation of 
  5600.            standard elementary functions (such as log an trigonometric 
  5601.            functions) for an arbitrary float type. 
  5602.  
  5603.            The following predefined instantiations of this package exist 
  5604.  
  5605.              Short_Float 
  5606.                          Ada.Numerics.Short_Elementary_Functions 
  5607.  
  5608.              Float 
  5609.                          Ada.Numerics.Elementary_Functions 
  5610.  
  5611.              Long_Float 
  5612.                          Ada.Numerics.Long_Elementary_Functions 
  5613.  
  5614.  Ada.Real_Time (D.8) 
  5615.            This package provides facilities similar to those of Calendar, but 
  5616.            operating with a finer clock suitable for real time control. 
  5617.  
  5618.  Ada.Sequential_IO (A.8.1) 
  5619.            This package provides input-output facilities for sequential files, 
  5620.            which can contain a sequence of values of a single type, which can 
  5621.            be any Ada type, including indefinite (unconstrained) types. 
  5622.  
  5623.  Ada.Storage_IO (A.9) 
  5624.            This package provides a facility for mapping arbitrary Ada types to 
  5625.            and from a storage buffer. It is primarily intended for the creation 
  5626.            of new IO packages. 
  5627.  
  5628.  Ada.Streams (13.13.1) 
  5629.            This is a generic package that provides the basic support for the 
  5630.            concept of streams as used by the stream attributes (Input, Output, 
  5631.            Read and Write). 
  5632.  
  5633.  Ada.Streams.Stream_IO (A.12.1) 
  5634.            This package is a specialization of the type Streams defined in 
  5635.            package Streams together with a set of operations providing 
  5636.            Stream_IO capability. The Stream_IO model permits both random and 
  5637.            sequential access to a file which can contain an arbitrary set of 
  5638.            values of one or more Ada types. 
  5639.  
  5640.  Ada.Strings (A.4.1) 
  5641.            This package provides some basic constants used by the string 
  5642.            handling packages. 
  5643.  
  5644.  Ada.Strings.Bounded (A.4.4) 
  5645.            This package provides facilities for handling variable length 
  5646.            strings. The bounded model requires a maximum length. It is thus 
  5647.            somewhat more limited than the unbounded model, but avoids the use 
  5648.            of dynamic allocation or finalization. 
  5649.  
  5650.  Ada.Strings.Fixed (A.4.3) 
  5651.            This package provides facilities for handling fixed length strings. 
  5652.  
  5653.  Ada.Strings.Maps (A.4.2) 
  5654.            This package provides facilities for handling character mappings and 
  5655.            arbitrarily defined subsets of characters. For instance it is useful 
  5656.            in defining specialized translation tables. 
  5657.  
  5658.  Ada.Strings.Maps.Constants (A.4.6) 
  5659.            This package provides a standard set of predefined mappings and 
  5660.            predefined character sets. For example, the standard upper to lower 
  5661.            case conversion table is found in this package. Note that upper to 
  5662.            lower case conversion is non-trivial if you want to take the entire 
  5663.            set of characters, including extended characters like E with an 
  5664.            acute accent, into account. You should use the mappings in this 
  5665.            package (rather than adding 32 yourself) to do case mappings. 
  5666.  
  5667.  Ada.Strings.Unbounded (A.4.5) 
  5668.            This package provides facilities for handling variable length 
  5669.            strings. The unbounded model allows arbitrary length strings, but 
  5670.            requires the use of dynamic allocation and finalization. 
  5671.  
  5672.  Ada.Strings.Wide_Bounded (A.4.7) 
  5673.  
  5674.  Ada.Strings.Wide_Fixed (A.4.7) 
  5675.  
  5676.  Ada.Strings.Wide_Maps (A.4.7) 
  5677.  
  5678.  Ada.Strings.Wide_Maps.Constants (A.4.7) 
  5679.  
  5680.  Ada.Strings.Wide_Unbounded (A.4.7) 
  5681.            These package provide analogous capabilities to the corresponding 
  5682.            packages without 'Wide_' in the name, but operate with the types 
  5683.            Wide_String and Wide_Character instead of String and Character. 
  5684.  
  5685.  Ada.Synchronous_Task_Control (D.10) 
  5686.            This package provides some standard facilities for controlling task 
  5687.            communication in a synchronous manner. 
  5688.  
  5689.  Ada.Tags 
  5690.            This package contains definitions for manipulation of the tags of 
  5691.            tagged values. 
  5692.  
  5693.  Ada.Task_Attributes 
  5694.            This package provides the capability of associating arbitrary 
  5695.            task-specific data with separate tasks. 
  5696.  
  5697.  Ada.Text_IO 
  5698.            This package provides basic text input-output capabilities for 
  5699.            character, string and numeric data. The subpackages of this package 
  5700.            are listed next. 
  5701.  
  5702.  Ada.Text_IO.Decimal_IO 
  5703.            Provides input-output facilities for decimal fixed-point types 
  5704.  
  5705.  Ada.Text_IO.Enumeration_IO 
  5706.            Provides input-output facilities for enumeration types. 
  5707.  
  5708.  Ada.Text_IO.Fixed_IO 
  5709.            Provides input-output facilities for ordinary fixed-point types. 
  5710.  
  5711.  Ada.Text_IO.Float_IO 
  5712.            Provides input-output facilities for float types. The following 
  5713.            predefined instantiations of this generic package are available: 
  5714.  
  5715.              Short_Float 
  5716.                          Short_Float_Text_IO 
  5717.  
  5718.              Float 
  5719.                          Float_Text_IO 
  5720.  
  5721.              Long_Float 
  5722.                          Long_Float_Text_IO 
  5723.  
  5724.  Ada.Text_IO.Integer_IO 
  5725.            Provides input-output facilities for integer types. The following 
  5726.            predefined instantiations of this generic package are available: 
  5727.  
  5728.              Short_Short_Integer 
  5729.                          Ada.Short_Short_Integer_Text_IO 
  5730.  
  5731.              Short_Integer 
  5732.                          Ada.Short_Integer_Text_IO 
  5733.  
  5734.              Integer 
  5735.                          Ada.Integer_Text_IO 
  5736.  
  5737.              Long_Integer 
  5738.                          Ada.Long_Integer_Text_IO 
  5739.  
  5740.              Long_Long_Integer 
  5741.                          Ada.Long_Long_Integer_Text_IO 
  5742.  
  5743.  Ada.Text_IO.Modular_IO 
  5744.            Provides input-output facilities for modular (unsigned) types 
  5745.  
  5746.  Ada.Text_IO.Complex_IO (G.1.3) 
  5747.            This package provides basic text input-output capabilities for 
  5748.            complex data. 
  5749.  
  5750.  Ada.Text_IO.Editing (F.3.3) 
  5751.            This package contains routines for edited output, analogous to the 
  5752.            use of pictures in COBOL. The picture formats used by this package 
  5753.            are a close copy of the facility in COBOL. 
  5754.  
  5755.  Ada.Text_IO.Text_Streams (A.12.2) 
  5756.            This package provides a facility that allows Text_IO files to be 
  5757.            treated as streams, so that the stream attributes can be used for 
  5758.            writing arbitrary data, including binary data, to Text_IO files. 
  5759.  
  5760.  Ada.Unchecked_Conversion (13.9) 
  5761.            This generic package allows arbitrary conversion from one type to 
  5762.            another of the same size, providing for breaking the type safety in 
  5763.            special circumstances. 
  5764.  
  5765.  Ada.Unchecked_Deallocation (13.11.2) 
  5766.            This generic package allows explicit freeing of storage previously 
  5767.            allocated by use of an allocator. 
  5768.  
  5769.  Ada.Wide_Text_IO (A.11) 
  5770.            This package is similar to Ada.Text_IO, except that the external 
  5771.            file supports wide character representations, and the internal types 
  5772.            are Wide_Character and Wide_String instead of Character and String. 
  5773.            It contains generic subpackages listed next. 
  5774.  
  5775.  Ada.Wide_Text_IO.Decimal_IO 
  5776.            Provides input-output facilities for decimal fixed-point types 
  5777.  
  5778.  Ada.Wide_Text_IO.Enumeration_IO 
  5779.            Provides input-output facilities for enumeration types. 
  5780.  
  5781.  Ada.Wide_Text_IO.Fixed_IO 
  5782.            Provides input-output facilities for ordinary fixed-point types. 
  5783.  
  5784.  Ada.Wide_Text_IO.Float_IO 
  5785.            Provides input-output facilities for float types. The following 
  5786.            predefined instantiations of this generic package are available: 
  5787.  
  5788.              Short_Float 
  5789.                          Short_Float_Wide_Text_IO 
  5790.  
  5791.              Float 
  5792.                          Float_Wide_Text_IO 
  5793.  
  5794.              Long_Float 
  5795.                          Long_Float_Wide_Text_IO 
  5796.  
  5797.  Ada.Wide_Text_IO.Integer_IO 
  5798.            Provides input-output facilities for integer types. The following 
  5799.            predefined instantiations of this generic package are available: 
  5800.  
  5801.              Short_Short_Integer 
  5802.                          Ada.Short_Short_Integer_Wide_Text_IO 
  5803.  
  5804.              Short_Integer 
  5805.                          Ada.Short_Integer_Wide_Text_IO 
  5806.  
  5807.              Integer 
  5808.                          Ada.Integer_Wide_Text_IO 
  5809.  
  5810.              Long_Integer 
  5811.                          Ada.Long_Integer_Wide_Text_IO 
  5812.  
  5813.              Long_Long_Integer 
  5814.                          Ada.Long_Long_Integer_Wide_Text_IO 
  5815.  
  5816.  Ada.Wide_Text_IO.Modular_IO 
  5817.            Provides input-output facilities for modular (unsigned) types 
  5818.  
  5819.  Ada.Wide_Text_IO.Complex_IO (G.1.3) 
  5820.            This package is similar to Ada.Text_IO.Complex_IO, except that the 
  5821.            external file supports wide character representations. 
  5822.  
  5823.  Ada.Wide_Text_IO.Editing (F.3.4) 
  5824.            This package is similar to Ada.Text_IO.Editing, except that the 
  5825.            types are Wide_Character and Wide_String instead of Character and 
  5826.            String. 
  5827.  
  5828.  Ada.Wide_Text_IO.Streams (A.12.3) 
  5829.            This package is similar to Ada.Text_IO.Streams, except that the 
  5830.            types are Wide_Character and Wide_String instead of Character and 
  5831.            String. 
  5832.  
  5833.  
  5834. ΓòÉΓòÉΓòÉ 10. The Implementation of Standard I/O ΓòÉΓòÉΓòÉ
  5835.  
  5836.  
  5837.  GNAT implements all the required input-output facilities described in A.6 
  5838.  through A.14. These sections of the Ada 95 reference manual describe the 
  5839.  required behavior of these packages from the Ada point of view, and if you are 
  5840.  writing a portable Ada program that does not need to know the exact manner in 
  5841.  which Ada maps to the outside world when it comes to reading or writing 
  5842.  external files, then you do not need to read this chapter. As long as your 
  5843.  files are all regular files (not pipes or devices), and as long as you write 
  5844.  and read the files only from Ada, the description in the Ada 95 reference 
  5845.  manual is sufficient. 
  5846.  
  5847.  However, if you want to do input-output to pipes or other devices, such as the 
  5848.  keyboard or screen, or if the files you are dealing with are either generated 
  5849.  by some other language, or to be read by some other language, then you need to 
  5850.  know more about the details of how the GNAT implementation of these 
  5851.  input-output facilities behaves. 
  5852.  
  5853.  In this chapter we give a detailed description of exactly how GNAT interfaces 
  5854.  to the file system. As always, the sources of the system are available to you 
  5855.  for answering questions at an even more detailed level, but for most purposes 
  5856.  the information in this chapter will suffice. 
  5857.  
  5858.  Another reason that you may need to know more about how input-output is 
  5859.  implemented arises when you have a program written in mixed languages where, 
  5860.  for example, files are shared between the C and Ada sections of the same 
  5861.  program. GNAT provides some additional facilities, in the form of additional 
  5862.  child library packages, that facilitate this sharing, and these additional 
  5863.  facilities are also described in this chapter. 
  5864.  
  5865.  Standard I/O Packages         Standard I/O Packages 
  5866.  FORM Strings                  FORM Strings 
  5867.  Direct_IO                     Direct_IO 
  5868.  Sequential_IO                 Sequential_IO 
  5869.  Text_IO                       Text_IO 
  5870.  Wide_Text_IO                  Wide_Text_IO 
  5871.  Stream_IO                     Stream_IO 
  5872.  Shared Files                  Shared Files 
  5873.  Open Modes                    Open Modes 
  5874.  Operations on C Streams       Operations on C Streams 
  5875.  Interfacing to C Streams      Interfacing to C Streams 
  5876.  
  5877.  
  5878. ΓòÉΓòÉΓòÉ 10.1. Standard I/O Packages ΓòÉΓòÉΓòÉ
  5879.  
  5880.  
  5881.  The Standard I/O packages described in Annex A for 
  5882.  
  5883.      Ada.Text_IO 
  5884.  
  5885.      Ada.Text_IO.Complex_IO 
  5886.  
  5887.      Ada.Text_IO.Text_Streams, 
  5888.  
  5889.      Ada.Wide_Text_IO 
  5890.  
  5891.      Ada.Wide_Text_IO.Complex_IO, 
  5892.  
  5893.      Ada.Wide_Text_IO.Text_Streams 
  5894.  
  5895.      Ada.Stream_IO 
  5896.  
  5897.      Ada.Sequential_IO 
  5898.  
  5899.      Ada.Direct_IO 
  5900.  
  5901.  are implemented using the C library streams facility; where 
  5902.  
  5903.      All files are opened using fopen. 
  5904.  
  5905.      All input/output operations use fread/fwrite. 
  5906.  
  5907.  There is no internal buffering of any kind at the Ada library level. The only 
  5908.  buffering is that provided at the system level in the implementation of the C 
  5909.  library routines that support streams. This facilitates shared use of these 
  5910.  streams by mixed language programs. 
  5911.  
  5912.  
  5913. ΓòÉΓòÉΓòÉ 10.2. FORM Strings ΓòÉΓòÉΓòÉ
  5914.  
  5915.  
  5916.  The format of a FORM string in GNAT is: 
  5917.  
  5918.                       "keyword=value,keyword=value,┬╖┬╖┬╖,keyword=value"
  5919.  
  5920.  where letters may be in upper or lower case, and there are no spaces between 
  5921.  values. The order of the entries is not important. Currently there are two 
  5922.  keywords defined. 
  5923.  
  5924.                       SHARED=[YES|NO]
  5925.                       WCEM=[n|h|u|s\e]
  5926.  
  5927.  The use of these parameters is described later in this section. 
  5928.  
  5929.  
  5930. ΓòÉΓòÉΓòÉ 10.3. Direct_IO ΓòÉΓòÉΓòÉ
  5931.  
  5932.  
  5933.  Direct_IO can only be instantiated for definite types. This is a restriction 
  5934.  of the Ada language, which means that the records are fixed length (the length 
  5935.  being determined by type'Size, rounded up to the next storage unit boundary if 
  5936.  necessary). 
  5937.  
  5938.  The records of a Direct_IO file are simply written to the file in index 
  5939.  sequence, with the first record starting at offset zero, and subsequent 
  5940.  records following. There is no control information of any kind. For example, 
  5941.  if 32-bit integers are being written, each record takes 4-bytes, so the record 
  5942.  at index K starts at offset (K - 1)*4. 
  5943.  
  5944.  There is no limit on the size of Direct_IO files, they are expanded as 
  5945.  necessary to accommodate whatever records are written to the file. 
  5946.  
  5947.  
  5948. ΓòÉΓòÉΓòÉ 10.4. Sequential_IO ΓòÉΓòÉΓòÉ
  5949.  
  5950.  
  5951.  Sequential_IO may be instantiated with either a definite (constrained) or 
  5952.  indefinite (unconstrained) type. 
  5953.  
  5954.  For the definite type case, the elements written to the file are simply the 
  5955.  memory images of the data values with no control information of any kind. The 
  5956.  resulting file should be read using the same type, no validity checking is 
  5957.  performed on input. 
  5958.  
  5959.  For the indefinite type case, the elements written consist of two parts. First 
  5960.  is the size of the data item, written as the memory image of a 
  5961.  Interfaces.C.size_t value, followed by the memory image of the data value. The 
  5962.  resulting file can only be read using the same (unconstrained) type. Normal 
  5963.  assignment checks are performed on these read operations, and if these checks 
  5964.  fail, Data_Error is raised. In particular, in the array case, the lengths must 
  5965.  match, and in the variant record case, if the variable for a particular read 
  5966.  operation is constrained, the discriminants must match. 
  5967.  
  5968.  Note that it is not possible to use Sequential_IO to write variable length 
  5969.  array items, and then read the data back into different length arrays. For 
  5970.  example, the following will raise Data_Error: 
  5971.  
  5972.                        package IO is new Sequential_IO (String);
  5973.                        F : IO.File_Type;
  5974.                        S : String (1┬╖┬╖4);
  5975.                        ┬╖┬╖┬╖
  5976.                        IO.Create (F)
  5977.                        IO.Write (F, "hello!")
  5978.                        IO.Reset (F, Mode=>In_File);
  5979.                        IO.Read (F, S);
  5980.                        Put_Line (S);
  5981.  
  5982.  On some Ada implementations, this will print 'hell', but the program is 
  5983.  clearly incorrect, since there is only one element in the file, and that 
  5984.  element is the string 'hello!'. 
  5985.  
  5986.  In Ada 95, this kind of behavior can be legitimately achieved using Stream_IO, 
  5987.  and this is the preferred mechanism. In particular, the above program fragment 
  5988.  rewritten to use Stream_IO will work correctly. 
  5989.  
  5990.  
  5991. ΓòÉΓòÉΓòÉ 10.5. Text_IO ΓòÉΓòÉΓòÉ
  5992.  
  5993.  
  5994.  Text_IO files consist of a stream of characters containing the following 
  5995.  special control characters: 
  5996.  
  5997.                       LF (line feed, 16#0A#) Line Mark
  5998.                       FF (form feed, 16#0C#) Page Mark
  5999.  
  6000.  A canonical Text_IO file is defined as one in which the following conditions 
  6001.  are met: 
  6002.  
  6003.      The character LF is used only as a line mark, i.e. to mark the end of the 
  6004.       line. 
  6005.  
  6006.      The character FF is used only as a page mark, i.e. to mark the end of a 
  6007.       page and consequently can appear only immediately following a LF (line 
  6008.       mark) character. 
  6009.  
  6010.      The file ends with either LF (line mark) or LF-FF (line mark, page mark). 
  6011.       In the former case, the page mark is implicitly assumed to be present. 
  6012.  
  6013.  A file written using Text_IO will be in canonical form provided that no 
  6014.  explicit LF or FF characters are written using Put or Put_Line. There will be 
  6015.  no FF character at the end of the file unless an explicit New_Page operation 
  6016.  was performed before closing the file. 
  6017.  
  6018.  A canonical Text_IO file that is a regular file, i.e. not a device or a pipe, 
  6019.  can be read using any of the routines in Text_IO. The semantics in this case 
  6020.  will be exactly as defined in the Ada 95 reference manual and all the routines 
  6021.  in Text_IO are fully implemented. 
  6022.  
  6023.  A text file that does not meet the requirements for a canonical Text_IO file 
  6024.  has one of the following: 
  6025.  
  6026.      The file contains FF characters not immediately following a LF character. 
  6027.  
  6028.      The file contains LF or FF characters written by Put or Put_Line, which 
  6029.       are not logically considered to be line marks or page marks. 
  6030.  
  6031.      The file ends in a character other than LF or FF, i.e. there is no 
  6032.       explicit line mark or page mark at the end of the file. 
  6033.  
  6034.  Text_IO can be used to read such non-standard text files but subprograms to do 
  6035.  with line or page numbers do not have defined meanings. In particular, a FF 
  6036.  character that does not follow a LF character may or may not be treated as a 
  6037.  page mark from the point of view of page and line numbering. Every LF 
  6038.  character is considered to end a line, and there is an implied LF character at 
  6039.  the end of the file. 
  6040.  
  6041.  Text_IO Stream Pointer PositioningText_IO Stream Pointer Positioning 
  6042.  Text_IO Reading and Writing Non-Regular FilesText_IO Reading and Writing 
  6043.                                Non-Regular Files 
  6044.  Get_Immediate                 Get_Immediate 
  6045.  Treating Text_IO Files as StreamsTreating Text_IO Files as Streams 
  6046.  Text_IO Extensions            Text_IO Extensions 
  6047.  Text_IO Facilities for Unbounded StringsText_IO Facilities for Unbounded 
  6048.                                Strings 
  6049.  
  6050.  
  6051. ΓòÉΓòÉΓòÉ 10.5.1. Stream Pointer Positioning ΓòÉΓòÉΓòÉ
  6052.  
  6053.  
  6054.  Ada.Text_IO has a definition of current position for a file that is being 
  6055.  read. No internal buffering occurs in Text_IO, and usually the physical 
  6056.  position in the stream used to implement the file corresponds to this logical 
  6057.  position defined by Text_IO. There are two exceptions: 
  6058.  
  6059.      After a call to End_Of_Page that returns True, the stream is positioned 
  6060.       past the LF (line mark) that precedes the page mark. Text_IO maintains an 
  6061.       internal flag so that subsequent read operations properly handle the 
  6062.       logical position which is unchanged by the End_Of_Page call. 
  6063.  
  6064.      After a call to End_Of_File that returns True, if the Text_IO file was 
  6065.       positioned before the line mark at the end of file before the call, then 
  6066.       the logical position is unchanged, but the stream is physically 
  6067.       positioned right at the end of file (past the line mark, and past a 
  6068.       possible page mark following the line mark. Again Text_IO maintains 
  6069.       internal flags so that subsequent read operations properly handle the 
  6070.       logical position. 
  6071.  
  6072.  These discrepancies have no effect on the observable behavior of Text_IO, but 
  6073.  if a single Ada stream is shared between a C program and Ada program, or 
  6074.  shared (using 'shared=yes' in the form string) between two Ada files, then the 
  6075.  difference may be observable in some situations. 
  6076.  
  6077.  
  6078. ΓòÉΓòÉΓòÉ 10.5.2. Reading and Writing Non-Regular Files ΓòÉΓòÉΓòÉ
  6079.  
  6080.  
  6081.  A non-regular file is a device (such as a keyboard), or a pipe. Text_IO can be 
  6082.  used for reading and writing. Writing is not affected and the sequence of 
  6083.  characters output is identical to the normal file case, but for reading, the 
  6084.  behavior of Text_IO is modified to avoid undesirable look-ahead as follows: 
  6085.  
  6086.  An input file that is not a regular file is considered to have no page marks. 
  6087.  Any Ascii.FF characters (the character normally used for a page mark) 
  6088.  appearing in the file are considered to be data characters. In particular: 
  6089.  
  6090.      Get_Line and Skip_Line do not test for a page mark following a line mark. 
  6091.       If a page mark appears, it will be treated as a data character. 
  6092.  
  6093.      This avoids the need to wait for an extra character to be typed or 
  6094.       entered from the pipe to complete one of these operations. 
  6095.  
  6096.      End_Of_Page always returns False 
  6097.  
  6098.      End_Of_File will return False if there is a page mark at the end of the 
  6099.       file. 
  6100.  
  6101.  Output to non-regular files is the same as for regular files. Page marks may 
  6102.  be written to non-regular files using New_Page, but as noted above they will 
  6103.  not be treated as page marks on input if the output is piped to another Ada 
  6104.  program. 
  6105.  
  6106.  Another important discrepancy when reading non-regular files is that the end 
  6107.  of file indication is not "sticky". If an end of file is entered, e.g. by 
  6108.  pressing the EOT key, then end of file is signalled once (i.e. the test 
  6109.  End_Of_File will yield True, or a read will raise End_Error), but then reading 
  6110.  can resume to read data past that end of file indication, until another end of 
  6111.  file indication is entered. 
  6112.  
  6113.  
  6114. ΓòÉΓòÉΓòÉ 10.5.3. Get_Immediate ΓòÉΓòÉΓòÉ
  6115.  
  6116.  
  6117.  Get_Immediate returns the next character (including control characters) from 
  6118.  the input file. In particular, Get_Immediate will return LF or FF characters 
  6119.  used as line marks or page marks. Such operations leave the file positioned 
  6120.  past the control character, and it is thus not treated as having its normal 
  6121.  function. This means that page, line and column counts after this kind of 
  6122.  Get_Immediate call are set as though the mark did not occur. In the case where 
  6123.  a Get_Immediate leaves the file positioned between the line mark and page mark 
  6124.  (which is not normally possible), it is undefined whether the FF character 
  6125.  will be treated as a page mark. 
  6126.  
  6127.  
  6128. ΓòÉΓòÉΓòÉ 10.5.4. Treating Text_IO Files as Streams ΓòÉΓòÉΓòÉ
  6129.  
  6130.  
  6131.  The package Text_IO.Streams allows a Text_IO file to be treated as a stream. 
  6132.  Data written to a Text_IO file in this stream mode is binary data. If this 
  6133.  binary data contains bytes 16#0A# (LF) or 16#0C# (FF), the resulting file may 
  6134.  have non-standard format. Similarly if read operations are used to read from a 
  6135.  Text_IO file treated as a stream, then LF and FF characters may be skipped and 
  6136.  the effect is similar to that described above for Get_Immediate. 
  6137.  
  6138.  
  6139. ΓòÉΓòÉΓòÉ 10.5.5. Text_IO Extensions ΓòÉΓòÉΓòÉ
  6140.  
  6141.  
  6142.  A package GNAT.IO_Aux in the GNAT library provides some useful extensions to 
  6143.  the standard Text_IO package: 
  6144.  
  6145.      function File_Exists (Name : String) return Boolean; 
  6146.       Determines if a file of the given name exists and can be successfully 
  6147.       opened (without actually performing the open operation). 
  6148.  
  6149.      function Get_Line return String; 
  6150.       Reads a string from the standard input file. The value returned is 
  6151.       exactly the length of the line that was read. 
  6152.  
  6153.      function Get_Line (File : Ada.Text_IO.File_Type) return String; 
  6154.       Similar, except that the parameter File specifies the file from which the 
  6155.       string is to be read. 
  6156.  
  6157.  
  6158. ΓòÉΓòÉΓòÉ 10.5.6. Text_IO Facilities for Unbounded Strings ΓòÉΓòÉΓòÉ
  6159.  
  6160.  
  6161.  The package Ada.Strings.Unbounded.Text_IO in library files a-suteio.ads/adb 
  6162.  contains some GNAT-specific subprograms useful for Text_IO operations on 
  6163.  unbounded strings: 
  6164.  
  6165.      function Get_Line (File : File_Type) return Unbounded_String; 
  6166.       Reads a line from the specified file and returns the result as an 
  6167.       unbounded string. 
  6168.  
  6169.      procedure Put (File : File_Type; U : Unbounded_String); 
  6170.       Writes the value of the given unbounded string to the specified file 
  6171.       Similar to the effect of Put (To_String (U)) except that an extra copy is 
  6172.       avoided. 
  6173.  
  6174.      procedure Put_Line (File : File_Type; U : Unbounded_String); 
  6175.       Writes the value of the given unbounded string to the specified file, 
  6176.       followed by a New_Line. Similar to the effect of Put_Line (To_String (U)) 
  6177.       except that an extra copy is avoided. 
  6178.  
  6179.  In the above procedures, File is of type Ada.Text_IO.File_Type and is 
  6180.  optional. If the parameter is omitted, then the standard input or output file 
  6181.  is referenced as appropriate. 
  6182.  
  6183.  The package Ada.Strings.Wide_Unbounded.Wide_Text_IO in library files 
  6184.  a-swuwti.ads/adb provides similar extended Wide_Text_IO functionality for 
  6185.  unbounded wide strings. 
  6186.  
  6187.  
  6188. ΓòÉΓòÉΓòÉ 10.6. Wide_Text_IO ΓòÉΓòÉΓòÉ
  6189.  
  6190.  
  6191.  Wide_Text_IO is similar in most respects to Text_IO, except that both input 
  6192.  and output files may contain special sequences that represent wide character 
  6193.  values. The encoding scheme for a given file may be specified using a FORM 
  6194.  parameter: 
  6195.  
  6196.                       WCEM=x
  6197.  
  6198.  as part of the FORM string (WCEM = wide character encoding method), where x is 
  6199.  one of the following characters 
  6200.  
  6201.  'h' 
  6202.            Hex ESC encoding 
  6203.  
  6204.  'u' 
  6205.            Upper half encoding 
  6206.  
  6207.  's' 
  6208.            Shift-JIS encoding 
  6209.  
  6210.  'e' 
  6211.            EUC Encoding 
  6212.  
  6213.  '8' 
  6214.            UTF-8 encoding 
  6215.  
  6216.  'b' 
  6217.            Brackets encoding 
  6218.  
  6219.  The encoding methods match those that can be used in a source program, but 
  6220.  there is no requirement that the encoding method used for the source program 
  6221.  be the same as the encoding method used for files, and different files may use 
  6222.  different encoding methods. 
  6223.  
  6224.  The default encoding method for the standard files, and for opened files for 
  6225.  which no WCEM parameter is given in the FORM string matches the wide character 
  6226.  encoding specified for the main program (the default being brackets encoding 
  6227.  if no coding method was specified with -gnatW). 
  6228.  
  6229.  Hex Coding 
  6230.            In this encoding, a wide character is represented by a five 
  6231.            character sequence: 
  6232.  
  6233.                       ESC a b c d
  6234.  
  6235.  where a, b, c, d are the four hexadecimal characters (using upper case 
  6236.  letters) of the wide character code. For example, ESC A345 is used to 
  6237.  represent the wide character with code 16#A345#. This scheme is compatible 
  6238.  with use of the full Wide_Character set. 
  6239.  
  6240.  Upper Half Coding 
  6241.            The wide character with encoding 16#abcd#, where the upper bit is on 
  6242.            (i.e. a is in the range 8-F) is represented as two bytes 16#ab# and 
  6243.            16#cd#. The second byte may never be a format control character, but 
  6244.            is not required to be in the upper half. This method can be also 
  6245.            used for shift-JIS or EUC where the internal coding matches the 
  6246.            external coding. 
  6247.  
  6248.  Shift JIS Coding 
  6249.            A wide character is represented by a two character sequence 16#ab# 
  6250.            and 16#cd#, with the restrictions described for upper half encoding 
  6251.            as described above. The internal character code is the corresponding 
  6252.            JIS character according to the standard algorithm for Shift-JIS 
  6253.            conversion. Only characters defined in the JIS code set table can be 
  6254.            used with this encoding method. 
  6255.  
  6256.  EUC Coding 
  6257.            A wide character is represented by a two character sequence 16#ab# 
  6258.            and 16#cd#, with both characters being in the upper half. The 
  6259.            internal character code is the corresponding JIS character according 
  6260.            to the EUC encoding algorithm. Only characters defined in the JIS 
  6261.            code set table can be used with this encoding method. 
  6262.  
  6263.  UTF-8 Coding 
  6264.            A wide character is represented using UCS Transformation Format 8 
  6265.            (UTF-8) as defined in Annex R of ISO 10646-1/Am.2.  Depending on the 
  6266.            character value, the representation is a one, two, or three byte 
  6267.            sequence: 
  6268.  
  6269.                       16#0000#-16#007f#: 2#0xxxxxxx#
  6270.                       16#0080#-16#07ff#: 2#110xxxxx# 2#10xxxxxx#
  6271.                       16#0800#-16#ffff#: 2#1110xxxx# 2#10xxxxxx# 2#10xxxxxx#
  6272.  
  6273.  where the xxx bits correspond to the left-padded bits of the the 16-bit 
  6274.  character value. Note that all lower half ASCII characters are represented as 
  6275.  ASCII bytes and all upper half characters and other wide characters are 
  6276.  represented as sequences of upper-half (The full UTF-8 scheme allows for 
  6277.  encoding 31-bit characters as 6-byte sequences, but in this implementation, 
  6278.  all UTF-8 sequences of four or more bytes length will raise a 
  6279.  Constraint_Error, as will all illegal UTF-8 sequences.) 
  6280.  
  6281.  Brackets Coding 
  6282.            In this encoding, a wide character is represented by the following 
  6283.            eight character sequence: 
  6284.  
  6285.                       [ " a b c d " ]
  6286.  
  6287.  Where a, b, c, d are the four hexadecimal characters (using uppercase letters) 
  6288.  of the wide character code. For example, ["A345"] is used to represent the 
  6289.  wide character with code 16#A345#. This scheme is compatible with use of the 
  6290.  full Wide_Character set. On input, brackets coding can also be used for upper 
  6291.  half characters, e.g. ["C1"] for lower case a. However, on output, brackets 
  6292.  notation is only used for wide characters with a code greater than 16#FF#. 
  6293.  
  6294.  For the coding schemes other than Hex and Brackets encoding, not all wide 
  6295.  character values can be represented. An attempt to output a character that 
  6296.  cannot be represented using the encoding scheme for the file causes 
  6297.  Constraint_Error to be raised. An invalid wide character sequence on input 
  6298.  also causes Constraint_Error to be raised. 
  6299.  
  6300.  Wide_Text_IO Stream Pointer PositioningWide_Text_IO Stream Pointer Positioning 
  6301.  Wide_Text_IO Reading and Writing Non-Regular FilesWide_Text_IO Reading and 
  6302.                                Writing Non-Regular Files 
  6303.  
  6304.  
  6305. ΓòÉΓòÉΓòÉ 10.6.1. Stream Pointer Positioning ΓòÉΓòÉΓòÉ
  6306.  
  6307.  
  6308.  Ada.Wide_Text_IO is similar to Ada.Text_IO in its handling of stream pointer 
  6309.  positioning (see Text_IO). There is one additional case: 
  6310.  
  6311.  If Ada.Wide_Text_IO.Look_Ahead reads a character outside the normal lower 
  6312.  ASCII set (i.e. a character in the range: 
  6313.  
  6314.                       Wide_Character'Val (16#0080#) ┬╖┬╖ Wide_Character'Val (16#FFFF#)
  6315.  
  6316.  then although the logical position of the file pointer is unchanged by the 
  6317.  Look_Ahead call, the stream is physically positioned past the wide character 
  6318.  sequence. Again this is to avoid the need for buffering or backup, and all 
  6319.  Wide_Text_IO routines check the internal indication that this situation has 
  6320.  occurred so that this is not visible to a normal program using Wide_Text_IO. 
  6321.  However, this discrepancy can be observed if the wide text file shares a 
  6322.  stream with another file. 
  6323.  
  6324.  
  6325. ΓòÉΓòÉΓòÉ 10.6.2. Reading and Writing Non-Regular Files ΓòÉΓòÉΓòÉ
  6326.  
  6327.  
  6328.  As in the case of Text_IO, when a non-regular file is read, it is assumed that 
  6329.  the file contains no page marks (any form characters are treated as data 
  6330.  characters), and End_Of_Page always returns False. Similarly, the end of file 
  6331.  indication is not sticky, so it is possible to read beyond an end of file. 
  6332.  
  6333.  
  6334. ΓòÉΓòÉΓòÉ 10.7. Stream_IO ΓòÉΓòÉΓòÉ
  6335.  
  6336.  
  6337.  A stream file is a sequence of bytes, where individual elements are written to 
  6338.  the file as described in the Ada 95 reference manual. The type Stream_Element 
  6339.  is simply a byte. There are two ways to read or write a stream file. 
  6340.  
  6341.      The operations Read and Write directly read or write a sequence of stream 
  6342.       elements with no control information. 
  6343.  
  6344.      The stream attributes applied to a stream file transfer data in the 
  6345.       manner described for stream attributes. 
  6346.  
  6347.  
  6348. ΓòÉΓòÉΓòÉ 10.8. Shared Files ΓòÉΓòÉΓòÉ
  6349.  
  6350.  
  6351.  Section A.14 of the Ada 95 Reference Manual allows implementations to provide 
  6352.  a wide variety of behavior if an attempt is made to access the same external 
  6353.  file with two or more internal files. 
  6354.  
  6355.  To provide a full range of functionality, while at the same time minimizing 
  6356.  the problems of portability caused by this implementation dependence, GNAT 
  6357.  handles file sharing as follows: 
  6358.  
  6359.      In the absence of a 'shared=xxx' form parameter, an attempt to open two 
  6360.       or more files with the same full name is considered an error and is not 
  6361.       supported. The exception Use_Error will be raised. Note that a file that 
  6362.       is not explicitly closed by the program remains open until the program 
  6363.       terminates. 
  6364.  
  6365.      If the form parameter 'shared=no' appears in the form string, the file 
  6366.       can be opened or created with its own separate stream identifier, 
  6367.       regardless of whether other files sharing the same external file are 
  6368.       opened. The exact effect depends on how the C stream routines handle 
  6369.       multiple accesses to the same external files using separate streams. 
  6370.  
  6371.      If the form parameter 'shared=yes' appears in the form string for each of 
  6372.       two or more files opened using the same full name, the same stream is 
  6373.       shared between these files, and the semantics are as described in Ada 95 
  6374.       Reference Manual, Section A.14. 
  6375.  
  6376.  When a program that opens multiple files with the same name is ported from 
  6377.  another Ada compiler to GNAT, the effect will be that Use_Error is raised. 
  6378.  
  6379.  The documentation of the original compiler and the documentation of the 
  6380.  program should then be examined to determine if file sharing was expected, and 
  6381.  'shared=xxx' parameters added to Open and Create calls as required. 
  6382.  
  6383.  When a program is ported from GNAT to some other Ada compiler, no special 
  6384.  attention is required unless the 'shared=xxx' form parameter is used in the 
  6385.  program. In this case, you must examine the documentation of the new compiler 
  6386.  to see if it supports the required file sharing semantics, and form strings 
  6387.  modified appropriately. Of course it may be the case that the program cannot 
  6388.  be ported if the target compiler does not support the required functionality. 
  6389.  The best approach in writing portable code is to avoid file sharing (and hence 
  6390.  the use of the 'shared=xxx' parameter in the form string) completely. 
  6391.  
  6392.  One common use of file sharing in Ada 83 is the use of instantiations of 
  6393.  Sequential_IO on the same file with different types, to achieve heterogenous 
  6394.  input-output. Although this approach will work in GNAT if 'shared=yes' is 
  6395.  specified, it is preferable in Ada 95 to use Stream_IO for this purpose (using 
  6396.  the stream attributes) 
  6397.  
  6398.  
  6399. ΓòÉΓòÉΓòÉ 10.9. Open Modes ΓòÉΓòÉΓòÉ
  6400.  
  6401.  
  6402.  Open and Create calls result in a call to fopen using the mode shown in Table 
  6403.  6.1 
  6404.  
  6405.   Table 6-1 Open and Create Call Modes
  6406.  
  6407.  
  6408.                                       OPEN       CREATE
  6409.                       Append_File           "r+"       "w+"
  6410.                       In_File             "r"        "w+"
  6411.                       Out_File (Direct_IO)      "r+"       "w"
  6412.                       Out_File (all other cases)   "w"        "w"
  6413.                       Inout_File           "r+"       "w+"
  6414.  
  6415.  If text file translation is required, then either 'b' or 't' is added to the 
  6416.  mode, depending on the setting of Text. Text file translation refers to the 
  6417.  mapping of CR/LF sequences in an external file to LF characters internally. 
  6418.  This mapping only occurs in DOS and DOS-like systems, and is not relevant to 
  6419.  other systems. 
  6420.  
  6421.  A special case occurs with Stream_IO. As shown in the above table, the file is 
  6422.  initially opened in 'r' or 'w' mode for the In_File and Out_File cases. If a 
  6423.  Set_Mode operation subsequently requires switching from reading to writing or 
  6424.  vice-versa, then the file is reopened in 'r+' mode to permit the required 
  6425.  operation. 
  6426.  
  6427.  
  6428. ΓòÉΓòÉΓòÉ 10.10. Operations on C Streams ΓòÉΓòÉΓòÉ
  6429.  
  6430.  The package Interfaces.C_Streams provides an Ada program with direct access to 
  6431.  the C library functions for operations on C streams: 
  6432.  
  6433.                       package Interfaces.C_Streams is
  6434.                        -- Note: the reason we do not use the types that are in
  6435.                        -- Interfaces.C is that we want to avoid dragging in the
  6436.                        -- code in this unit if possible.
  6437.                        subtype chars is System.Address;
  6438.                        -- Pointer to null-terminated array of characters
  6439.                        subtype FILEs is System.Address;
  6440.                        -- Corresponds to the C type FILE*
  6441.                        subtype voids is System.Address;
  6442.                        -- Corresponds to the C type void*
  6443.                        subtype int is Integer;
  6444.                        subtype long is Long_Integer;
  6445.                        -- Note: the above types are subtypes deliberately, and it
  6446.                        -- is part of this spec that the above correspondences are
  6447.                        -- guaranteed. This means that it is legitimate to, for
  6448.                        -- example, use Integer instead of int. We provide these
  6449.                        -- synonyms for clarity, but in some cases it may be
  6450.                        -- convenient to use the underlying types (for example to
  6451.                        -- avoid an unnecessary dependency of a spec on the spec
  6452.                        -- of this unit).
  6453.                        type size_t is mod 2 ** Standard'Address_Size;
  6454.                        NULL_Stream : constant FILEs;
  6455.                        -- Value returned (NULL in C) to indicate an
  6456.                        -- fdopen/fopen/tmpfile error
  6457.                        ----------------------------------
  6458.                        -- Constants Defined in stdio.h --
  6459.                        ----------------------------------
  6460.                        EOF : constant int;
  6461.                        -- Used by a number of routines to indicate error or
  6462.                        -- end of file
  6463.                        IOFBF : constant int;
  6464.                        IOLBF : constant int;
  6465.                        IONBF : constant int;
  6466.                        -- Used to indicate buffering mode for setvbuf call
  6467.                        SEEK_CUR : constant int;
  6468.                        SEEK_END : constant int;
  6469.                        SEEK_SET : constant int;
  6470.                        -- Used to indicate origin for fseek call
  6471.                        function stdin return FILEs;
  6472.                        function stdout return FILEs;
  6473.                        function stderr return FILEs;
  6474.                        -- Streams associated with standard files
  6475.                        --------------------------
  6476.                        -- Standard C functions --
  6477.                        --------------------------
  6478.                        -- The functions selected below are ones that are
  6479.                        -- available in DOS, OS/2, UNIX and Xenix (but not
  6480.                        -- necessarily in ANSI C). These are very thin interfaces
  6481.                        -- which copy exactly the C headers. For more
  6482.                        -- documentation on these functions, see the Microsoft C
  6483.                        -- "Run-Time Library Reference" (Microsoft Press, 1990,
  6484.                        -- ISBN 1-55615-225-6), which includes useful information
  6485.                        -- on system compatibility.
  6486.                        procedure clearerr (stream : FILEs);
  6487.                        function fclose (stream : FILEs) return int;
  6488.                        function fdopen (handle : int; mode : chars) return FILEs;
  6489.                        function feof (stream : FILEs) return int;
  6490.                        function ferror (stream : FILEs) return int;
  6491.                        function fflush (stream : FILEs) return int;
  6492.                        function fgetc (stream : FILEs) return int;
  6493.                        function fgets (strng : chars; n : int; stream : FILEs)
  6494.                          return chars;
  6495.                        function fileno (stream : FILEs) return int;
  6496.                        function fopen (filename : chars; Mode : chars)
  6497.                          return FILEs;
  6498.                        -- Note: to maintain target independence, use
  6499.                        -- text_translation_required, a boolean variable defined in
  6500.                        -- a-sysdep.c to deal with the target dependent text
  6501.                        -- translation requirement. If this variable is set,
  6502.                        -- then  b/t should be appended to the standard mode
  6503.                        -- argument to set the text translation mode off or on
  6504.                        -- as required.
  6505.                        function fputc (C : int; stream : FILEs) return int;
  6506.                        function fputs (Strng : chars; Stream : FILEs) return int;
  6507.                        function fread
  6508.                          (buffer : voids;
  6509.                          size : size_t;
  6510.                          count : size_t;
  6511.                          stream : FILEs)
  6512.                          return size_t;
  6513.                        function freopen
  6514.                          (filename : chars;
  6515.                          mode : chars;
  6516.                          stream : FILEs)
  6517.                          return FILEs;
  6518.                        function fseek
  6519.                          (stream : FILEs;
  6520.                          offset : long;
  6521.                          origin : int)
  6522.                          return int;
  6523.                        function ftell (stream : FILEs) return long;
  6524.                        function fwrite
  6525.                          (buffer : voids;
  6526.                          size : size_t;
  6527.                          count : size_t;
  6528.                          stream : FILEs)
  6529.                          return size_t;
  6530.                        function isatty (handle : int) return int;
  6531.                        procedure mktemp (template : chars);
  6532.                        -- The return value (which is just a pointer to template)
  6533.                        -- is discarded
  6534.                        procedure rewind (stream : FILEs);
  6535.                        function rmtmp return int;
  6536.                        function setvbuf
  6537.                          (stream : FILEs;
  6538.                          buffer : chars;
  6539.                          mode : int;
  6540.                          size : size_t)
  6541.                          return int;
  6542.                        function tmpfile return FILEs;
  6543.                        function ungetc (c : int; stream : FILEs) return int;
  6544.                        function unlink (filename : chars) return int;
  6545.                        ---------------------
  6546.                        -- Extra functions --
  6547.                        ---------------------
  6548.                        -- These functions supply slightly thicker bindings than
  6549.                        -- those above. They are derived from functions in the
  6550.                        -- C Run-Time Library, but may do a bit more work than
  6551.                        -- just directly calling one of the Library functions.
  6552.                        function is_regular_file (handle : int) return int;
  6553.                        -- Tests if given handle is for a regular file (result 1)
  6554.                        -- or for a non-regular file (pipe or device, result 0).
  6555.                        ---------------------------------
  6556.                        -- Control of Text/Binary Mode --
  6557.                        ---------------------------------
  6558.                        -- If text_translation_required is true, then the following
  6559.                        -- functions may be used to dynamically switch a file from
  6560.                        -- binary to text mode or vice versa. These functions have
  6561.                        -- no effect if text_translation_required is false (i.e. in
  6562.                        -- normal UNIX mode). Use fileno to get a stream handle.
  6563.                        procedure set_binary_mode (handle : int);
  6564.                        procedure set_text_mode (handle : int);
  6565.                        ----------------------------
  6566.                        -- Full Path Name support --
  6567.                        ----------------------------
  6568.                        procedure full_name (nam : chars; buffer : chars);
  6569.                        -- Given a NUL terminated string representing a file
  6570.                        -- name, returns in buffer a NUL terminated string
  6571.                        -- representing the full path name for the file name.
  6572.                        -- On systems where it is relevant the  drive is also
  6573.                        -- part of the full path name. It is the responsibility
  6574.                        -- of the caller to pass an actual parameter for buffer
  6575.                        -- that is big enough for any full path name. Use
  6576.                        -- max_path_len given below as the size of buffer.
  6577.                        max_path_len : integer;
  6578.                        -- Maximum length of an allowable full path name on the
  6579.                        -- system, including a terminating NUL character.
  6580.                       end Interfaces.C_Streams;
  6581.  
  6582.  
  6583. ΓòÉΓòÉΓòÉ 10.11. Interfacing to C Streams ΓòÉΓòÉΓòÉ
  6584.  
  6585.  
  6586.  The packages in this section permit interfacing Ada files to C Stream 
  6587.  operations. 
  6588.  
  6589.                        with Interfaces.C_Streams;
  6590.                        package Ada.Sequential_IO.C_Streams is
  6591.                         function C_Stream (F : File_Type)
  6592.                           return Interfaces.C_Streams.FILEs;
  6593.                         procedure Open
  6594.                          (File : in out File_Type;
  6595.                           Mode : in File_Mode;
  6596.                           C_Stream : in Interfaces.C_Streams.FILEs;
  6597.                           Form : in String := "");
  6598.                        end Ada.Sequential_IO.C_Streams;
  6599.                        with Interfaces.C_Streams;
  6600.                        package Ada.Direct_IO.C_Streams is
  6601.                          function C_Stream (F : File_Type)
  6602.                           return Interfaces.C_Streams.FILEs;
  6603.                          procedure Open
  6604.                           (File : in out File_Type;
  6605.                           Mode : in File_Mode;
  6606.                           C_Stream : in Interfaces.C_Streams.FILEs;
  6607.                           Form : in String := "");
  6608.                        end Ada.Direct_IO.C_Streams;
  6609.                        with Interfaces.C_Streams;
  6610.                        package Ada.Text_IO.C_Streams is
  6611.                          function C_Stream (F : File_Type)
  6612.                           return Interfaces.C_Streams.FILEs;
  6613.                          procedure Open
  6614.                           (File : in out File_Type;
  6615.                           Mode : in File_Mode;
  6616.                           C_Stream : in Interfaces.C_Streams.FILEs;
  6617.                           Form : in String := "");
  6618.                        end Ada.Text_IO.C_Streams;
  6619.                        with Interfaces.C_Streams;
  6620.                        package Ada.Wide_Text_IO.C_Streams is
  6621.                          function C_Stream (F : File_Type)
  6622.                           return Interfaces.C_Streams.FILEs;
  6623.                          procedure Open
  6624.                           (File : in out File_Type;
  6625.                           Mode : in File_Mode;
  6626.                           C_Stream : in Interfaces.C_Streams.FILEs;
  6627.                           Form : in String := "");
  6628.                        end Ada.Wide_Text_IO.C_Streams;
  6629.                        with Interfaces.C_Streams;
  6630.                        package Ada.Stream_IO.C_Streams is
  6631.                         function C_Stream (F : File_Type)
  6632.                           return Interfaces.C_Streams.FILEs;
  6633.                         procedure Open
  6634.                          (File : in out File_Type;
  6635.                           Mode : in File_Mode;
  6636.                           C_Stream : in Interfaces.C_Streams.FILEs;
  6637.                           Form : in String := "");
  6638.                        end Ada.Stream_IO.C_Streams;
  6639.  
  6640.  In each of these five packages, the C_Stream function obtains the FILE pointer 
  6641.  from a currently opened Ada file. It is then possible to use the 
  6642.  Interfaces.C_Streams package to operate on this stream, or the stream can be 
  6643.  passed to a C program which can operate on it directly. Of course the program 
  6644.  is responsible for ensuring that only appropriate sequences of operations are 
  6645.  executed. 
  6646.  
  6647.  One particular use of relevance to an Ada program is that the setvbuf function 
  6648.  can be used to control the buffering of the stream used by an Ada file. In the 
  6649.  absence of such a call the standard default buffering is used. 
  6650.  
  6651.  The Open procedures in these packages open a file giving an existing C Stream 
  6652.  instead of a file name. Typically this stream is imported from a C program, 
  6653.  allowing an Ada file to operate on an existing C file. 
  6654.  
  6655.  
  6656. ΓòÉΓòÉΓòÉ 11. The GNAT Library ΓòÉΓòÉΓòÉ
  6657.  
  6658.  
  6659.  The GNAT library contains a number of general and special purpose packages. It 
  6660.  represents functionality that the GNAT developers have found useful, and which 
  6661.  is made available to GNAT users. The packages described here are fully 
  6662.  supported, and upwards compatibility will be maintained in future releases, so 
  6663.  you can use these facilities with the confidence that the same functionality 
  6664.  will be available in future releases. 
  6665.  
  6666.  The chapter here simply gives a brief summary of the facilities available. The 
  6667.  full documentation is found in the spec file for the package. The full sources 
  6668.  of these library packages, including both spec and body, are provided with all 
  6669.  GNAT releases. For example, to find out the full specifications of the SPITBOL 
  6670.  pattern matching capability, including a full tutorial and extensive examples, 
  6671.  look in the g-spipat.ads file in the library. 
  6672.  
  6673.  For each entry here, the package name (as it would appear in a with clause) is 
  6674.  given, followed by the name of the corresponding spec file in parentheses. 
  6675.  
  6676.  GNAT.Bubble_Sort_A (g-busora.ads)GNAT.Bubble_Sort_A (g-busora.ads) 
  6677.  GNAT.Bubble_Sort_G (g-busorg.ads)GNAT.Bubble_Sort_G (g-busorg.ads) 
  6678.  GNAT.Calendar (g-calend.ads)  GNAT.Calendar (g-calend.ads) 
  6679.  GNAT.Case_Util (g-casuti)     GNAT.Case_Util (g-casuti) 
  6680.  GNAT.Calendar.Time_IO (g-catiio.ads)GNAT.Calendar.Time_IO (g-catiio.ads) 
  6681.  GNAT.Command_Line (g-comlin.ads)GNAT.Command_Line (g-comlin.ads) 
  6682.  GNAT.Current_Exception (g-curexc.ads)GNAT.Current_Exception (g-curexc.ads) 
  6683.  GNAT.Debug_Pools (g-debpoo.ads)GNAT.Debug_Pools (g-debpoo.ads) 
  6684.  GNAT.Debug_Utilities (g-debuti.ads)GNAT.Debug_Utilities (g-debuti.ads) 
  6685.  GNAT.Directory_Operations (g-dirope.ads)GNAT.Directory_Operations 
  6686.                                (g-dirope.ads) 
  6687.  GNAT.Float_Control (g-flocon.ads)GNAT.Float_Control (g-flocon.ads) 
  6688.  GNAT.Heap_Sort_A (g-hesora.ads)GNAT.Heap_Sort_A (g-hesora.ads) 
  6689.  GNAT.Heap_Sort_G (g-hesorg.ads)GNAT.Heap_Sort_G (g-hesorg.ads) 
  6690.  GNAT.HTable (g-htable.ads)    GNAT.HTable (g-htable.ads) 
  6691.  GNAT.IO (g-io.ads)            GNAT.IO (g-io.ads) 
  6692.  GNAT.IO_Aux (g-io_aux.ads)    GNAT.IO_Aux (g-io_aux.ads) 
  6693.  GNAT.Lock_Files (g-locfil.ads)GNAT.Lock_Files (g-locfil.ads) 
  6694.  GNAT.OS_Lib (g-os_lib.ads)    GNAT.OS_Lib (g-os_lib.ads) 
  6695.  GNAT.Regexp (g-regexp.ads)    GNAT.Regexp (g-regexp.ads) 
  6696.  GNAT.Regpat (g-regpat.ads)    GNAT.Regpat (g-regpat.ads) 
  6697.  GNAT.Spell_Checker (g-speche.ads)GNAT.Spell_Checker (g-speche.ads) 
  6698.  GNAT.Spitbol.Patterns (g-spipat.ads)GNAT.Spitbol.Patterns (g-spipat.ads) 
  6699.  GNAT.Spitbol (g-spitbo.ads)   GNAT.Spitbol (g-spitbo.ads) 
  6700.  GNAT.SPITBOL.Table_Boolean (g-sptabo.ads)GNAT.SPITBOL.Table_Boolean 
  6701.                                (g-sptabo.ads) 
  6702.  GNAT.SPITBOL.Table_Integer (g-sptain.ads)GNAT.SPITBOL.Table_Integer 
  6703.                                (g-sptain.ads) 
  6704.  GNAT.SPITBOL.Table_VString (g-sptavs.ads)GNAT.SPITBOL.Table_VString 
  6705.                                (g-sptavs.ads) 
  6706.  GNAT.Table (g-table.ads)      GNAT.Table (g-table.ads) 
  6707.  GNAT.Task_Lock (g-tasloc.ads) GNAT.Task_Lock (g-tasloc.ads) 
  6708.  GNAT.Threads (g-thread.ads)   GNAT.Threads (g-thread.ads) 
  6709.  GNAT.Traceback (g-traceb.ads) GNAT.Traceback (g-traceb.ads) 
  6710.  GNAT.Traceback.Symbolic (g-trasym.ads)GNAT.Traceback.Symbolic (g-trasym.ads) 
  6711.  
  6712.  
  6713. ΓòÉΓòÉΓòÉ 11.1. GNAT.Bubble_Sort_A (g-busora.ads) ΓòÉΓòÉΓòÉ
  6714.  
  6715.  
  6716.  Provides a general implementation of bubble sort usable for sorting arbitrary 
  6717.  data items. Move and comparison procedures are provided by passing 
  6718.  access-to-procedure values. 
  6719.  
  6720.  
  6721. ΓòÉΓòÉΓòÉ 11.2. GNAT.Bubble_Sort_G (g-busorg.ads) ΓòÉΓòÉΓòÉ
  6722.  
  6723.  
  6724.  Similar to Bubble_Sort_A except that the move and sorting procedures are 
  6725.  provided as generic parameters, this improves efficiency, especially if the 
  6726.  procedures can be inlined, at the expense of duplicating code for multiple 
  6727.  instantiations. 
  6728.  
  6729.  
  6730. ΓòÉΓòÉΓòÉ 11.3. GNAT.Calendar (g-calend.ads) ΓòÉΓòÉΓòÉ
  6731.  
  6732.  
  6733.  Extends the facilities provided by Ada.Calendar to include handling of days of 
  6734.  the week, an extended Split and Time_Of capability. Also provides conversion 
  6735.  of Ada.Calendar.Time values to and from the C timeval format. 
  6736.  
  6737.  
  6738. ΓòÉΓòÉΓòÉ 11.4. GNAT.Case_Util (g-casuti) ΓòÉΓòÉΓòÉ
  6739.  
  6740.  
  6741.  A set of simple routines for handling upper and lower casing of strings 
  6742.  without the overhead of the full casing tables in Ada.Characters.Handling. 
  6743.  
  6744.  
  6745. ΓòÉΓòÉΓòÉ 11.5. GNAT.Calendar.Time_IO (g-catiio.ads) ΓòÉΓòÉΓòÉ
  6746.  
  6747.  
  6748.  Provides an extended capability for formatted output of time values with full 
  6749.  user control over the format. Modeled on the GNU Date specification. 
  6750.  
  6751.  
  6752. ΓòÉΓòÉΓòÉ 11.6. GNAT.Command_Line (g-comlin.ads) ΓòÉΓòÉΓòÉ
  6753.  
  6754.  
  6755.  Provides a high level interface to Ada.Command_Line facilities, including the 
  6756.  ability to scan for named switches with optional parameters and expand file 
  6757.  names using wild card notations. 
  6758.  
  6759.  
  6760. ΓòÉΓòÉΓòÉ 11.7. GNAT.Current_Exception (g-curexc.ads) ΓòÉΓòÉΓòÉ
  6761.  
  6762.  
  6763.  Provides access to information on the current exception that has been raised 
  6764.  without the need for using the Ada-95 exception choice parameter specification 
  6765.  syntax. This is particularly useful in mimicing typical facilities for 
  6766.  obtaining information about exceptions provided by Ada 83 compilers. 
  6767.  
  6768.  
  6769. ΓòÉΓòÉΓòÉ 11.8. GNAT.Debug_Pools (g-debpoo.ads) ΓòÉΓòÉΓòÉ
  6770.  
  6771.  
  6772.  Provide a debugging storage pools that helps tracking memory corruption 
  6773.  problems. See section "Finding memory problems with GNAT Debug Pool" in the 
  6774.  GNAT User's guide. 
  6775.  
  6776.  
  6777. ΓòÉΓòÉΓòÉ 11.9. GNAT.Debug_Utilities (g-debuti.ads) ΓòÉΓòÉΓòÉ
  6778.  
  6779.  
  6780.  Provides a few useful utilities for debugging purposes, including conversion 
  6781.  to and from string images of address values. 
  6782.  
  6783.  
  6784. ΓòÉΓòÉΓòÉ 11.10. GNAT.Directory_Operations (g-dirope.ads) ΓòÉΓòÉΓòÉ
  6785.  
  6786.  
  6787.  Provides a set of routines for manipulating directories, including changing 
  6788.  the current directory, making new directories, and scanning the files in a 
  6789.  directory. 
  6790.  
  6791.  
  6792. ΓòÉΓòÉΓòÉ 11.11. GNAT.Float_Control (g-flocon.ads) ΓòÉΓòÉΓòÉ
  6793.  
  6794.  
  6795.  Provides an interface for resetting the floating-point processor into the mode 
  6796.  required for correct semantic operation in Ada. Some third party library calls 
  6797.  may cause this mode to be modified, and the Reset procedure in this package 
  6798.  can be used to reestablish the required mode. 
  6799.  
  6800.  
  6801. ΓòÉΓòÉΓòÉ 11.12. GNAT.Heap_Sort_A (g-hesora.ads) ΓòÉΓòÉΓòÉ
  6802.  
  6803.  
  6804.  Provides a general implementation of heap sort usable for sorting arbitrary 
  6805.  data items. Move and comparison procedures are provided by passing 
  6806.  access-to-procedure values. The algorithm used is a modified heap sort that 
  6807.  performs approximately N*log(N) comparisons in the worst case. 
  6808.  
  6809.  
  6810. ΓòÉΓòÉΓòÉ 11.13. GNAT.Heap_Sort_G (g-hesorg.ads) ΓòÉΓòÉΓòÉ
  6811.  
  6812.  
  6813.  Similar to Heap_Sort_A except that the move and sorting procedures are 
  6814.  provided as generic parameters, this improves efficiency, especially if the 
  6815.  procedures can be inlined, at the expense of duplicating code for multiple 
  6816.  instantiations. 
  6817.  
  6818.  
  6819. ΓòÉΓòÉΓòÉ 11.14. GNAT.HTable (g-htable.ads) ΓòÉΓòÉΓòÉ
  6820.  
  6821.  
  6822.  A generic implementation of hash tables that can be used to hash arbitrary 
  6823.  data. Provides two approaches, one a simple static aproach, and the other 
  6824.  allowing arbitrary dynamic hash tables. 
  6825.  
  6826.  
  6827. ΓòÉΓòÉΓòÉ 11.15. GNAT.IO (g-io.ads) ΓòÉΓòÉΓòÉ
  6828.  
  6829.  
  6830.  A simple preealborable input-output package that provides a subset of simple 
  6831.  Text_IO functions for reading and writing strings and characters. 
  6832.  
  6833.  
  6834. ΓòÉΓòÉΓòÉ 11.16. GNAT.IO_Aux (g-io_aux.ads) ΓòÉΓòÉΓòÉ
  6835.  
  6836.  Provides some auxliiary functions for use with Text_IO, including a test for 
  6837.  whether a file exists, and functions for reading a line of text. 
  6838.  
  6839.  
  6840. ΓòÉΓòÉΓòÉ 11.17. GNAT.Lock_Files (g-locfil.ads) ΓòÉΓòÉΓòÉ
  6841.  
  6842.  
  6843.  Provides a general interface for using files as locks. Can be used for 
  6844.  providing program level synchronization. 
  6845.  
  6846.  
  6847. ΓòÉΓòÉΓòÉ 11.18. GNAT.OS_Lib (g-os_lib.ads) ΓòÉΓòÉΓòÉ
  6848.  
  6849.  
  6850.  Provides a range of target independent operating system interface functions, 
  6851.  including time/date management, file operations, subprocess management, 
  6852.  including a portable spawn procedure, and access to environment variables and 
  6853.  error return codes. 
  6854.  
  6855.  
  6856. ΓòÉΓòÉΓòÉ 11.19. GNAT.Regexp (g-regexp.ads) ΓòÉΓòÉΓòÉ
  6857.  
  6858.  
  6859.  A simple implementation of regular expressions, using a subset of regular 
  6860.  expression syntax copied from famoiliar Unix style utilities. This is the 
  6861.  simples of the three pattern matching packages provided, and is particularly 
  6862.  suitable for "file globbing" applications. 
  6863.  
  6864.  
  6865. ΓòÉΓòÉΓòÉ 11.20. GNAT.Regpat (g-regpat.ads) ΓòÉΓòÉΓòÉ
  6866.  
  6867.  
  6868.  A complete implementation of Unix-style regular expression matching, copied 
  6869.  from the original V7 style regular expression library written in C by Henry 
  6870.  Spencer (and binary compatible with this C library). 
  6871.  
  6872.  
  6873. ΓòÉΓòÉΓòÉ 11.21. GNAT.Spell_Checker (g-speche.ads) ΓòÉΓòÉΓòÉ
  6874.  
  6875.  
  6876.  Provides a function for determining whether one string is a plausible near 
  6877.  misspelling of another string. 
  6878.  
  6879.  
  6880. ΓòÉΓòÉΓòÉ 11.22. GNAT.Spitbol.Patterns (g-spipat.ads) ΓòÉΓòÉΓòÉ
  6881.  
  6882.  
  6883.  A complete implementation of SNOBOL4 style pattern matching. This is the most 
  6884.  elaborate of the pattern matching packages provided. It fully duplicates the 
  6885.  SNOBOL4 dynamic pattern construction and matching capabilities, using the 
  6886.  efficient algorithm developed by Robert Dewar for the SPITBOL system. 
  6887.  
  6888.  
  6889. ΓòÉΓòÉΓòÉ 11.23. GNAT.Spitbol (g-spitbo.ads) ΓòÉΓòÉΓòÉ
  6890.  
  6891.  
  6892.  The top level package of the collection of SPITBOL-style funcionality, this 
  6893.  package provides basic SNOBOL4 string manipulation functions, such as Pad, 
  6894.  Reverse, Trim, Substr capability, as well as a generic table function useful 
  6895.  for contructing arbitrary mappings from strings in the style of the SNOBOL4 
  6896.  TABLE function. 
  6897.  
  6898.  
  6899. ΓòÉΓòÉΓòÉ 11.24. GNAT.SPITBOL.Table_Boolean (g-sptabo.ads) ΓòÉΓòÉΓòÉ
  6900.  
  6901.  
  6902.  A library level of instantiation of GNAT.Spitbol.Patterns.Table for type 
  6903.  Standard.Boolean, giving an implementation of sets of string values. 
  6904.  
  6905.  
  6906. ΓòÉΓòÉΓòÉ 11.25. GNAT.SPITBOL.Table_Integer (g-sptain.ads) ΓòÉΓòÉΓòÉ
  6907.  
  6908.  
  6909.  A library level of instantiation of GNAT.Spitbol.Patterns.Table for type 
  6910.  Standard.Integer, giving an implementation of maps from string to integer 
  6911.  values. 
  6912.  
  6913.  
  6914. ΓòÉΓòÉΓòÉ 11.26. GNAT.SPITBOL.Table_VString (g-sptavs.ads) ΓòÉΓòÉΓòÉ
  6915.  
  6916.  
  6917.  A library level of instantiation of GNAT.Spitbol.Patterns.Table for a variable 
  6918.  length string type, giving an implementation of general maps from strings to 
  6919.  strings. 
  6920.  
  6921.  
  6922. ΓòÉΓòÉΓòÉ 11.27. GNAT.Table (g-table.ads) ΓòÉΓòÉΓòÉ
  6923.  
  6924.  
  6925.  A generic package providing a single dimension array abstraction where the 
  6926.  length of the array can be dynamically modified. 
  6927.  
  6928.  
  6929. ΓòÉΓòÉΓòÉ 11.28. GNAT.Task_Lock (g-tasloc.ads) ΓòÉΓòÉΓòÉ
  6930.  
  6931.  
  6932.  A very simple facility for locking and unlocking sections of code using a 
  6933.  single global task lock. Appropriate for use in situations where contention 
  6934.  between tasks is very rarely expected. 
  6935.  
  6936.  
  6937. ΓòÉΓòÉΓòÉ 11.29. GNAT.Threads (g-thread.ads) ΓòÉΓòÉΓòÉ
  6938.  
  6939.  
  6940.  Provides facilities for creating and destroying threads with explicit calls. 
  6941.  These threads are known to the GNAT run-time system. These subprograms are 
  6942.  exported C-convention procedures intended to be called from foreign code. By 
  6943.  using these primitives rather than directly calling operating systems 
  6944.  routines, compatibility with the Ada tasking runt-time is provided. 
  6945.  
  6946.  
  6947. ΓòÉΓòÉΓòÉ 11.30. GNAT.Traceback (g-traceb.ads) ΓòÉΓòÉΓòÉ
  6948.  
  6949.  
  6950.  Provides a facility for obtaining non-symbolic traceback information, useful 
  6951.  in various debugging situations. 
  6952.  
  6953.  
  6954. ΓòÉΓòÉΓòÉ 11.31. GNAT.Traceback.Symbolic (g-trasym.ads) ΓòÉΓòÉΓòÉ
  6955.  
  6956.  
  6957.  Provides symbolic traceback information that includes the subprogram name and 
  6958.  line number information 
  6959.  
  6960.  
  6961. ΓòÉΓòÉΓòÉ 12. Interfacing to Other Languages ΓòÉΓòÉΓòÉ
  6962.  
  6963.  
  6964.  The facilities in annex B of the Ada 95 Reference Manual are fully implemented 
  6965.  in GNAT, and in addition, a full interface to C++ is provided. 
  6966.  
  6967.  Interfacing to C              Interfacing to C 
  6968.  Interfacing to C++            Interfacing to C++ 
  6969.  Interfacing to COBOL          Interfacing to COBOL 
  6970.  Interfacing to Fortran        Interfacing to Fortran 
  6971.  Interfacing to non-GNAT Ada codeInterfacing to non-GNAT Ada code 
  6972.  
  6973.  
  6974. ΓòÉΓòÉΓòÉ 12.1. Interfacing to C ΓòÉΓòÉΓòÉ
  6975.  
  6976.  
  6977.  Interfacing to C with GNAT can use one of two approaches: 
  6978.  
  6979.    1. The types in the package Interfaces.C may be used. 
  6980.  
  6981.    2. Standard Ada types may be used directly. This may be less portable to 
  6982.       other compilers, but will work on all GNAT compilers, which guarantee 
  6983.       correspondence between the C and Ada types. 
  6984.  
  6985.  Pragma Convention C maybe applied to Ada types, but mostly has no effect, 
  6986.  since this is the default. The following table shows the correspondence 
  6987.  between Ada scalar types and the corresponding C types. 
  6988.  
  6989.  Integer 
  6990.            int 
  6991.  
  6992.  Short_Integer 
  6993.            short 
  6994.  
  6995.  Short_Short_Integer 
  6996.            signed char 
  6997.  
  6998.  Long_Integer 
  6999.            long 
  7000.  
  7001.  Long_Long_Integer 
  7002.            long long 
  7003.  
  7004.  Short_Float 
  7005.            float 
  7006.  
  7007.  Float 
  7008.            float 
  7009.  
  7010.  Long_Float 
  7011.            double 
  7012.  
  7013.  Long_Long_Float 
  7014.            This is the longest floating-point type supported by the hardware. 
  7015.  
  7016.      Ada enumeration types map to C enumeration types directly if pragma 
  7017.       Convention C is specified, which causes them to have int length. Without 
  7018.       pragma Convention C, Ada enumeration types map to 8, 16, or 32 bits (i.e. 
  7019.       C types signed char, short, int respectively) depending on the number of 
  7020.       values passed. This is the only case in which pragma Convention C affects 
  7021.       the representation of an Ada type. 
  7022.  
  7023.      Ada access types map to C pointers, except for the case of pointers to 
  7024.       unconstrained types in Ada, which have no direct C equivalent. 
  7025.  
  7026.      Ada arrays map directly to C arrays. 
  7027.  
  7028.      Ada records map directly to C structures. 
  7029.  
  7030.      Packed Ada records map to C structures where all members are bit fields 
  7031.       of the length corresponding to the type'Size value in Ada. 
  7032.  
  7033.  
  7034. ΓòÉΓòÉΓòÉ 12.2. Interfacing to C++ ΓòÉΓòÉΓòÉ
  7035.  
  7036.  
  7037.  The interface to C++ makes use of the following pragmas, which are primarily 
  7038.  intended to be constructed automatically using a binding generator tool, 
  7039.  although it is possible to construct them by hand. Ada Core Technologies does 
  7040.  not currently supply a suitable binding generator tool. 
  7041.  
  7042.  Using these pragmas it is possible to achieve complete inter-operability 
  7043.  between Ada tagged types and C class definitions. See Implementation Defined 
  7044.  Pragmas for more details. 
  7045.  
  7046.  pragma CPP_Class ([Entity =>] local_name) 
  7047.            The argument denotes an entity in the current declarative region 
  7048.            that is declared as a tagged or untagged record type. It indicates 
  7049.            that the type corresponds to an externally declared C++ class type, 
  7050.            and is to be laid out the same way that C++ would lay out the type. 
  7051.  
  7052.  pragma CPP_Constructor ([Entity =>] local_name) 
  7053.            This pragma identifies an imported function (imported in the usual 
  7054.            way with pragma Import) as corresponding to a C++ constructor. 
  7055.  
  7056.  pragma CPP_Vtable ┬╖┬╖┬╖ 
  7057.            One CPP_Vtable pragma can be present for each component of type 
  7058.            CPP.Interfaces.Vtable_Ptr in a record to which pragma CPP_Class 
  7059.            applies. 
  7060.  
  7061.  
  7062. ΓòÉΓòÉΓòÉ 12.3. Interfacing to COBOL ΓòÉΓòÉΓòÉ
  7063.  
  7064.  
  7065.  Interfacing to COBOL is achieved as described in section B.4 of the Ada 95 
  7066.  reference manual. 
  7067.  
  7068.  
  7069. ΓòÉΓòÉΓòÉ 12.4. Interfacing to Fortran ΓòÉΓòÉΓòÉ
  7070.  
  7071.  
  7072.  Interfacing to Fortran is achieved as described in section B.5 of the 
  7073.  reference manual. The pragma Convention Fortran, applied to a multi- 
  7074.  dimensional array causes the array to be stored in column-major order as 
  7075.  required for convenient interface to Fortran. 
  7076.  
  7077.  
  7078. ΓòÉΓòÉΓòÉ 12.5. Interfacing to non-GNAT Ada code ΓòÉΓòÉΓòÉ
  7079.  
  7080.  It is possible to specify the convention Ada in a pragma Import or pragma 
  7081.  Export. However this refers to the calling conventions used by GNAT, which may 
  7082.  or may not be similar enough to those used by some other Ada 83 or Ada 95 
  7083.  compiler to allow interoperation. 
  7084.  
  7085.  If arguments types are kept simple, and if the foreign compiler generally 
  7086.  follows system calling conventions, then it may be possible to integrate files 
  7087.  compiled by other Ada compilers, provided that the elaboration issues are 
  7088.  adequately addressed (for example by eliminating the need for any load time 
  7089.  elaboration). 
  7090.  
  7091.  In particular, GNAT running on VMS is designed to be highly compatible with 
  7092.  the DEC Ada 83 compiler, so this is one case in which it is possible to import 
  7093.  foreign units of this type, provided that the data items passed are restricted 
  7094.  to simple scalar values or simple record types without variants, or simple 
  7095.  array types with fixed bounds. 
  7096.  
  7097.  
  7098. ΓòÉΓòÉΓòÉ 13. Machine Code Insertions ΓòÉΓòÉΓòÉ
  7099.  
  7100.  
  7101.  Package Machine_Code provides machine code support as described in the Ada 95 
  7102.  Reference Manual in two separate forms: 
  7103.  
  7104.      Machine code statements, consisting of qualified expressions that fit the 
  7105.       requirements of RM section 13.8. 
  7106.  
  7107.      An intrinsic callable procedure, providing an alternative mechanism of 
  7108.       including machine instructions in a subprogram. 
  7109.  
  7110.  The two features are similar, and both closely related to the mechanism 
  7111.  provided by the asm instruction in the GNU C compiler. Full understanding and 
  7112.  use of the facilities in this package requires understanding the asm 
  7113.  instruction as described in Using and Porting GNU CC by Richard Stallman. 
  7114.  Calls to the function Asm and the procedure Asm have identical semantic 
  7115.  restrictions and effects as described below. Both are provided so that the 
  7116.  procedure call can be used as a statement, and the function call can be used 
  7117.  to form a code_statement. 
  7118.  
  7119.  The first example given in the GNU CC documentation is the C asm instruction: 
  7120.  
  7121.                         asm ("fsinx %1 %0" : "=f" (result) : "f" (angle));
  7122.  
  7123.  The equivalent can be written for GNAT as: 
  7124.  
  7125.                       Asm ("fsinx %1 %0",
  7126.                          My_Float'Asm_Output ("=f", result),
  7127.                          My_Float'Asm_Input  ("f",  angle));
  7128.  
  7129.  The first argument to Asm is the assembler template, and is identical to what 
  7130.  is used in GNU CC. This string must be a static expression.  The second 
  7131.  argument is the output operand list. It is either a single Asm_Output 
  7132.  attribute reference, or a list of such references enclosed in parentheses 
  7133.  (technically an array aggregate of such references). 
  7134.  
  7135.  The Asm_Output attribute denotes a function that takes two parameters.  The 
  7136.  first is a string, the second is the name of a variable of the type designated 
  7137.  by the attribute prefix. The first (string) argument is required to be a 
  7138.  static expression and designates the constraint for the parameter (e.g. what 
  7139.  kind of register is required). The second argument is the variable to be 
  7140.  updated with the result. The possible values for constraint are the same as 
  7141.  those used in the RTL, and are dependent on the configuration file used to 
  7142.  build the GCC back end.  If there are no output operands, then this argument 
  7143.  may either be omitted, or explicitly given as No_Output_Operands. 
  7144.  
  7145.  The second argument of my_float'Asm_Output functions as though it were an out 
  7146.  parameter, which is a little curious, but all names have the form of 
  7147.  expressions, so there is no syntactic irregularity, even though normally 
  7148.  functions would not be permitted out parameters.  The third argument is the 
  7149.  list of input operands. It is either a single Asm_Input attribute reference, 
  7150.  or a list of such references enclosed in parentheses (technically an array 
  7151.  aggregate of such references). 
  7152.  
  7153.  The Asm_Input attribute denotes a function that takes two parameters.  The 
  7154.  first is a string, the second is an expression of the type designated by the 
  7155.  prefix. The first (string) argument is required to be a static expression, and 
  7156.  is the constraint for the parameter, (e.g. what kind of register is required). 
  7157.  The second argument is the value to be used as the input argument. The 
  7158.  possible values for the constant are the same as those used in the RTL, and 
  7159.  are dependent on the configuration file used to built the GCC back end. 
  7160.  
  7161.  If there are no input operands, this argument may either be omitted, or 
  7162.  explicitly given as No_Input_Operands.  The fourth argument, not present in 
  7163.  the above example, is a list of register names, called the clobber argument. 
  7164.  This argument, if given, must be a static string expression, and is a space or 
  7165.  comma separated list of names of registers that must be considered destroyed 
  7166.  as a result of the Asm call. If this argument is the null string (the default 
  7167.  value), then the code generator assumes that no additional registers are 
  7168.  destroyed. 
  7169.  
  7170.  The fifth argument, not present in the above example, called the volatile 
  7171.  argument, is by default False. It can be set to the literal value True to 
  7172.  indicate to the code generator that all optimizations with respect to the 
  7173.  instruction specified should be suppressed, and that in particular, for an 
  7174.  instruction that has outputs, the instruction will still be generated, even if 
  7175.  none of the outputs are used. See the full description in the GCC manual for 
  7176.  further details. 
  7177.  
  7178.  The Asm subprograms may be used in two ways. First the procedure forms can be 
  7179.  used anywhere a procedure call would be valid, and correspond to what the RM 
  7180.  calls ``intrinsic'' routines. Such calls can be used to intersperse machine 
  7181.  instructions with other Ada statements. Second, the function forms, which 
  7182.  return a dummy value of the limited private type Asm_Insn, can be used in code 
  7183.  statements, and indeed this is the only context where such calls are allowed. 
  7184.  Code statements appear as aggregates of the form: 
  7185.  
  7186.                       Asm_Insn'(Asm (┬╖┬╖┬╖));
  7187.                       Asm_Insn'(Asm_Volatile (┬╖┬╖┬╖));
  7188.  
  7189.  In accordance with RM rules, such code statements are allowed only within 
  7190.  subprograms whose entire body consists of such statements.  It is not 
  7191.  permissible to intermix such statements with other Ada statements. 
  7192.  
  7193.  Typically the form using intrinsic procedure calls is more convenient and more 
  7194.  flexible. The code statement form is provided to meet the RM suggestion that 
  7195.  such a facility should be made available.  The following is the exact syntax 
  7196.  of the call to Asm (of course if named notation is used, the arguments may be 
  7197.  given in arbitrary order, following the normal rules for use of positional and 
  7198.  named arguments) 
  7199.  
  7200.                       ASM_CALL ::= Asm (
  7201.                                [Template =>] static_string_EXPRESSION
  7202.                               [,[Outputs  =>] OUTPUT_OPERAND_LIST    ]
  7203.                               [,[Inputs  =>] INPUT_OPERAND_LIST    ]
  7204.                               [,[Clobber  =>] static_string_EXPRESSION ]
  7205.                               [,[Volatile =>] static_boolean_EXPRESSION] )
  7206.                       OUTPUT_OPERAND_LIST ::=
  7207.                        No_Output_Operands
  7208.                       | OUTPUT_OPERAND_ATTRIBUTE
  7209.                       | (OUTPUT_OPERAND_ATTRIBUTE {,OUTPUT_OPERAND_ATTRIBUTE})
  7210.                       OUTPUT_OPERAND_ATTRIBUTE ::=
  7211.                        SUBTYPE_MARK'Asm_Output (static_string_EXPRESSION, NAME)
  7212.                       INPUT_OPERAND_LIST ::=
  7213.                        No_Input_Operands
  7214.                       | INPUT_OPERAND_ATTRIBUTE
  7215.                       | (INPUT_OPERAND_ATTRIBUTE {,INPUT_OPERAND_ATTRIBUTE})
  7216.                       INPUT_OPERAND_ATTRIBUTE ::=
  7217.                        SUBTYPE_MARK'Asm_Input (static_string_EXPRESSION, EXPRESSION)
  7218.  
  7219.  
  7220. ΓòÉΓòÉΓòÉ 14. GNAT Implementation of Tasking ΓòÉΓòÉΓòÉ
  7221.  
  7222.  Mapping Ada Tasks onto the Underlying Kernel ThreadsMapping Ada Tasks onto the 
  7223.                                Underlying Kernel Threads 
  7224.  Ensuring Compliance with the Real-Time AnnexEnsuring Compliance with the 
  7225.                                Real-Time Annex 
  7226.  
  7227.  
  7228. ΓòÉΓòÉΓòÉ 14.1. Mapping Ada Tasks onto the Underlying Kernel Threads ΓòÉΓòÉΓòÉ
  7229.  
  7230.  GNAT run-time system comprises two layers: 
  7231.  
  7232.      GNARL (GNAT Run-time  Layer) 
  7233.  
  7234.      GNULL (GNAT Low-level Library) 
  7235.  
  7236.  In GNAT, Ada's tasking services rely on a platform and OS independent layer 
  7237.  known as GNARL. This code is responsible for implementing the correct 
  7238.  semantics of Ada's task creation, rendez-vous, protected operations etc. 
  7239.  
  7240.  GNARL decomposes Ada's tasking semantics into simpler lower level operations 
  7241.  such as create a thread, set the priority of a thread, yield, create a lock, 
  7242.  lock/unlock, etc. The spec for these low-level operations constitutes GNULLI, 
  7243.  the GNULL Interface. This interface is directly inspired from the POSIX 
  7244.  real-time API. 
  7245.  
  7246.  If the underlying executive or OS implements the POSIX standard faithfully, 
  7247.  the GNULL Interface maps as is to the services offered by the underlying 
  7248.  kernel. Otherwise, some target dependent glue code maps the services offered 
  7249.  by the underlying kernel to the semantics expected by GNARL. 
  7250.  
  7251.  Whatever the underlying OS (VxWorks, UNIX, OS/2, Windows NT, etc.) the key 
  7252.  point is that each Ada task is mapped on a thread in the underlying kernel. 
  7253.  For example, in the case of VxWorks 
  7254.  
  7255.     1 Ada task = 1 VxWorks task 
  7256.  
  7257.  In addition Ada task priorities map onto the underlying thread priorities. 
  7258.  Mapping Ada tasks onto the underlying kernel threads has several advantages: 
  7259.  
  7260.    1. The underlying scheduler is used to schedule the Ada tasks. This makes 
  7261.       Ada tasks as efficient as kernel threads from a scheduling standpoint. 
  7262.  
  7263.    2. Interaction with code written in C containing threads is eased since at 
  7264.       the lowest level Ada tasks and C threads map onto the same underlying 
  7265.       kernel concept. 
  7266.  
  7267.    3. When an Ada task is blocked during I/O the remaining Ada tasks are able 
  7268.       to proceed. 
  7269.  
  7270.    4. On multi-processor systems Ada Tasks can execute in parallel. 
  7271.  
  7272.  
  7273. ΓòÉΓòÉΓòÉ 14.2. Ensuring Compliance with the Real-Time Annex ΓòÉΓòÉΓòÉ
  7274.  
  7275.  The reader will be quick to notice that while mapping Ada tasks onto the 
  7276.  underlying threads has significant advantages, it does create some 
  7277.  complications when it comes to respecting the scheduling semantics specified 
  7278.  in the real-time annex (Annex D). 
  7279.  
  7280.  For instance Annex D requires that for the FIFO_Within_Priorities scheduling 
  7281.  policy we have: 
  7282.  
  7283.    9  When the active priority of a ready task that is not running     changes, 
  7284.  or the setting of its base priority takes effect, the     task is removed from 
  7285.  the ready queue for its old active priority     and is added at the tail of 
  7286.  the ready queue for its new active     priority, except in the case where the 
  7287.  active priority is lowered     due to the loss of inherited priority, in which 
  7288.  case the task is     added at the head of the ready queue for its new active 
  7289.  priority. 
  7290.  
  7291.  While most kernels do put tasks at the end of the priority queue when a task 
  7292.  changes its priority, (which respects the main FIFO_Within_Priorities 
  7293.  requirement), almost none keep a thread at the beginning of its priority queue 
  7294.  when its priority drops from the loss of inherited priority. 
  7295.  
  7296.  As a result most vendors have provided incomplete Annex D implementations. 
  7297.  
  7298.  The GNAT run-time, has a nice cooperative solution to this problem which 
  7299.  ensures that accurate FIFO_Within_Priorities semantics are respected. 
  7300.  
  7301.  The principle is as follows. When an Ada task T is about to start running, it 
  7302.  checks whether some other Ada task R with the same priority as T has been 
  7303.  suspended due to the loss of priority inheritance. If this is the case, T 
  7304.  yields and is placed at the end of its priority queue. When R arrives at the 
  7305.  front of the queue it executes. 
  7306.  
  7307.  Note that this simple scheme preserves the relative order of the tasks that 
  7308.  were ready to execute in the priority queue where R has been placed at the 
  7309.  end. 
  7310.  
  7311.  
  7312. ΓòÉΓòÉΓòÉ 15. Code generation for array aggregates ΓòÉΓòÉΓòÉ
  7313.  
  7314.  Static constant aggregates with static boundsStatic constant aggregates with 
  7315.                                static bounds 
  7316.  Constant aggregates with an unconstrained nominal typesConstant aggregates 
  7317.                                with an unconstrained nominal types 
  7318.  Aggregates with static bounds Aggregates with static bounds 
  7319.  Aggregates with non-static boundsAggregates with non-static bounds 
  7320.  Aggregates in assignments statementsAggregates in assignments statements 
  7321.  Aggregate have a rich syntax and allow the user to specify the values of 
  7322.  complex data structures by means of a single construct. As a result, the code 
  7323.  generated for aggregates can be quite complex and involve loops, case 
  7324.  statements and multiple assignments. In the simplest cases, however, the 
  7325.  compiler will recognize aggregates whose components and constraints are fully 
  7326.  static, and in those cases the compiler will generate little or no executable 
  7327.  code. The following is an outline of the code that GNAT generates for various 
  7328.  aggregate constructs. For further details, the user will find it useful to 
  7329.  examine the output produced by the -gnatG flag to see the expanded source that 
  7330.  is input to the code generator.  The user will also want to examine the 
  7331.  assembly code generated at various levels of optimization. 
  7332.  
  7333.  The code generated for aggregates depends on the context, the component 
  7334.  values, and the type. In the context of an object declaration the code 
  7335.  generated is generally simpler than in the case of an assignment. As a general 
  7336.  rule, static component values and static subtypes also lead to simpler code. 
  7337.  
  7338.  
  7339. ΓòÉΓòÉΓòÉ 15.1. Static constant aggregates with static bounds ΓòÉΓòÉΓòÉ
  7340.  
  7341.   For the declarations: 
  7342.  
  7343.  
  7344.                         type One_Dim is array (1┬╖┬╖10) of integer;
  7345.                         ar0 : constant One_Dim := ( 1, 2, 3, 4, 5, 6, 7, 8, 9, 0);
  7346.  
  7347.  GNAT generates no executable code: the constant ar0 is placed in static 
  7348.  memory. The same is true for constant aggregates with named associations: 
  7349.  
  7350.  
  7351.                         Cr1 : constant One_Dim := (4 => 16, 2 => 4, 3 => 9, 1=> 1);
  7352.                         Cr3 : constant One_Dim := (others => 7777);
  7353.    The same is true for multidimensional constant arrays such as: 
  7354.  
  7355.  
  7356.                         type two_dim is array (1┬╖┬╖3, 1┬╖┬╖3) of integer;
  7357.                         Unit : constant two_dim := ( (1,0,0), (0,1,0), (0,0,1));
  7358.   The same is true for arrays of one-dimensional arrays: the following are 
  7359.  static: 
  7360.  
  7361.  
  7362.                       type ar1b is array (1┬╖┬╖3) of boolean;
  7363.                       type ar_ar is array (1┬╖┬╖3) of ar1b;
  7364.                       None : constant ar1b := (others => false);    --  fully static
  7365.                       None2 : constant ar_ar := (1┬╖┬╖3 => None);    --  fully static
  7366.   However, for multidimensional aggregates with named associations, GNAT will 
  7367.  generate assignments and loops, even if all associations are static. The 
  7368.  following two declarations generate a loop for the first dimension, and 
  7369.  individual component assignments for the second dimension: 
  7370.  
  7371.  
  7372.                       Zero1: constant two_dim := (1┬╖┬╖3 => (1┬╖┬╖3 => 0));
  7373.                       Zero2: constant two_dim := (others => (others => 0));
  7374.  
  7375.  
  7376. ΓòÉΓòÉΓòÉ 15.2. Constant aggregates with an unconstrained nominal types ΓòÉΓòÉΓòÉ
  7377.  
  7378.  In such cases the aggregate itself establishes the subtype, so that 
  7379.  associations with "others" cannot be used. GNAT determines the bounds for the 
  7380.  actual subtype of the aggregate, and allocates the aggregate statically as 
  7381.  well. No code is generated for the following: 
  7382.  
  7383.  
  7384.                         type One_Unc is array (natural range <>) of integer;
  7385.                         Cr_Unc : constant One_Unc := (12,24,36);
  7386.  
  7387.  
  7388. ΓòÉΓòÉΓòÉ 15.3. Aggregates with static bounds ΓòÉΓòÉΓòÉ
  7389.  
  7390.  In all previous examples the aggregate was the initial (and immutable) value 
  7391.  of a constant. If the aggregate initializes a variable, then code is generated 
  7392.  for it as a combination of individual assignments and loops over the target 
  7393.  object. The declarations 
  7394.  
  7395.  
  7396.                           Cr_Var1 : One_Dim := (2, 5, 7, 11);
  7397.                           Cr_Var2 : One_Dim := (others > -1);
  7398.   generate the equivalent of 
  7399.  
  7400.  
  7401.                           Cr_Var1 (1) := 2;
  7402.                           Cr_Var1 (2) := 3;
  7403.                           Cr_Var1 (3) := 5;
  7404.                           Cr_Var1 (4) := 11;
  7405.  
  7406.                           for I in Cr_Var2'range loop
  7407.                            Cr_Var2 (I) := =-1;
  7408.                           end loop;
  7409.  
  7410.  
  7411. ΓòÉΓòÉΓòÉ 15.4. Aggregates with non-static bounds ΓòÉΓòÉΓòÉ
  7412.  
  7413.  If the bounds of the aggregate are not statically compatible with the bounds 
  7414.  of the nominal subtype  of the target, then constraint checks have to be 
  7415.  generated on the bounds. For a multidimensional array, constraint checks may 
  7416.  have to be applied to sub-arrays individually, if they do not have statically 
  7417.  compatible subtypes. 
  7418.  
  7419.  
  7420. ΓòÉΓòÉΓòÉ 15.5. Aggregates in assignments statements ΓòÉΓòÉΓòÉ
  7421.  
  7422.  In general, aggregate assignment requires the construction of a temporary, and 
  7423.  a copy from the temporary to the target of the assignment. This is because it 
  7424.  is not always possible to convert the assignment into a series of individual 
  7425.  component assignments. For example, consider the simple case: 
  7426.  
  7427.  
  7428.       A := (A(2), A(1));  This cannot be converted into: 
  7429.  
  7430.  
  7431.                           A(1) := A(2);
  7432.                           A(2) := A(1);
  7433.   So the aggregate has to be built first in a separate location, and then 
  7434.  copied into the target. GNAT recognizes simple cases where this intermediate 
  7435.  step is not required, and the assignments can be performed in place, directly 
  7436.  into the target. The following sufficient criteria are applied: 
  7437.  
  7438.    1. The bounds of the aggregate are static, and the associations are static. 
  7439.  
  7440.    2. The components of the aggregate are static constants, names of 
  7441.         simple variables that are not renamings, or expressions not involving 
  7442.       indexed components whose operands obey these rules. 
  7443.   If any of these conditions are violated, the aggregate will be built in a 
  7444.  temporary (created either by the front-end or the code generator) and then 
  7445.  that temporary will be copied onto the target. 
  7446.  
  7447.  
  7448. ΓòÉΓòÉΓòÉ 16. Specialized Needs Annexes ΓòÉΓòÉΓòÉ
  7449.  
  7450.  
  7451.  Ada 95 defines a number of specialized needs annexes, which are not required 
  7452.  in all implementations. However, as described in this chapter, GNAT implements 
  7453.  all of these special needs annexes: 
  7454.  
  7455.  Systems Programming (Annex C) 
  7456.            The systems programming annex is fully implemented. 
  7457.  
  7458.  Real-Time Systems (Annex D) 
  7459.            The real-time systems annex is fully implemented. 
  7460.  
  7461.  Distributed Systems (Annex E) 
  7462.            Stub generation is fully implemented in the GNAT compiler. In 
  7463.            addition, a complete compatible PCS is available as part of the 
  7464.            GLADE system, a separate product available from Ada Core 
  7465.            Technologies. When the two products are used in conjunction, this 
  7466.            annex is fully implemented. 
  7467.  
  7468.  Information Systems (Annex F) 
  7469.            The information systems annex is fully implemented. 
  7470.  
  7471.  Numerics (Annex G) 
  7472.            The numerics annex is fully implemented. 
  7473.  
  7474.  Safety and Security (Annex H) 
  7475.            The safety and security annex is fully implemented. 
  7476.  
  7477.  
  7478. ΓòÉΓòÉΓòÉ 17. Compatibility Guide ΓòÉΓòÉΓòÉ
  7479.  
  7480.  
  7481.  This chapter contains sections that describe compatibility issues between GNAT 
  7482.  and other Ada 83 and Ada 95 compilation systems, to aid in porting 
  7483.  applications developed in other Ada environments. 
  7484.  
  7485.  Compatibility with Ada 83     Compatibility with Ada 83 
  7486.  Compatibility with DEC Ada 83 Compatibility with DEC Ada 83 
  7487.  Compatibility with Other Ada 95 SystemsCompatibility with Other Ada 95 Systems 
  7488.  Representation Clauses        Representation Clauses 
  7489.  
  7490.  
  7491. ΓòÉΓòÉΓòÉ 17.1. Compatibility with Ada 83 ΓòÉΓòÉΓòÉ
  7492.  
  7493.  
  7494.  Ada 95 is designed to be highly upwards compatible with Ada 83. In particular, 
  7495.  the design intention is that the difficulties associated with moving from Ada 
  7496.  83 to Ada 95 should be no greater than those that occur when moving from one 
  7497.  Ada 83 system to another. 
  7498.  
  7499.  However, there are a number of points at which there are minor 
  7500.  incompatibilities. The Ada 95 Annotated Reference Manual contains full details 
  7501.  of these issues, and should be consulted for a complete treatment. In practice 
  7502.  the following are the most likely issues to be encountered. 
  7503.  
  7504.  Character range 
  7505.            The range of Standard.Character is now the full 256 characters of 
  7506.            Latin-1, whereas in most Ada 83 implementations it was restricted to 
  7507.            128 characters. This may show up as compile time or runtime errors. 
  7508.            The desirable fix is to adapt the program to accommodate the full 
  7509.            character set, but in some cases it may be convenient to define a 
  7510.            subtype or derived type of Character that covers only the restricted 
  7511.            range. 
  7512.  
  7513.  New reserved words 
  7514.            The identifiers abstract, aliased, protected, requeue, tagged, and 
  7515.            until are reserved in Ada 95. Existing Ada 83 code using any of 
  7516.            these identifiers must be edited to use some alternative name. 
  7517.  
  7518.  Freezing rules 
  7519.            The rules in Ada 95 are slightly different with regard to the point 
  7520.            at which entities are frozen, and representation pragmas and clauses 
  7521.            are not permitted past the freeze point. This shows up most 
  7522.            typically in the form of an error message complaining that a 
  7523.            representation item appears too late, and the appropriate corrective 
  7524.            action is to move the item nearer to the declaration of the entity 
  7525.            to which it refers. 
  7526.  
  7527.            A particular case is that representation pragmas (including the 
  7528.            extended DEC Ada 83 compatibility pragmas such as Export_Procedure), 
  7529.            cannot be applied to a subprogram body. If necessary, a separate 
  7530.            subprogram declaration must be introduced to which the pragma can be 
  7531.            applied. 
  7532.  
  7533.  Optional bodies for library packages 
  7534.            In Ada 83, a package that did not require a package body was 
  7535.            nevertheless allowed to have one. This lead to certain surprises in 
  7536.            compiling large systems (situations in which the body could be 
  7537.            unexpectedly ignored). In Ada 95, if a package does not require a 
  7538.            body then it is not permitted to have a body. To fix this problem, 
  7539.            simply remove a redundant body if it is empty, or, if it is 
  7540.            non-empty, introduce a dummy declaration into the spec that makes 
  7541.            the body required. One approach is to add a private part to the 
  7542.            package declaration (if necessary), and define a parameterless 
  7543.            procedure called Requires_Body, which must then be given a dummy 
  7544.            procedure body in the package body, which then becomes required. 
  7545.  
  7546.  Numeric_Error is now the same as Constraint_Error 
  7547.            In Ada 95, the exception Numeric_Error is a renaming of 
  7548.            Constraint_Error. This means that it is illegal to have separate 
  7549.            exception handlers for the two exceptions. The fix is simply to 
  7550.            remove the handler for the Numeric_Error case (since even in Ada 83, 
  7551.            a compiler was free to raise Constraint_Error in place of 
  7552.            Numeric_Error in all cases). 
  7553.  
  7554.  Indefinite subtypes in generics 
  7555.            In Ada 83, it was permissible to pass an indefinite type (e.g. 
  7556.            String) as the actual for a generic formal private type, but then 
  7557.            the instantiation would be illegal if there were any instances of 
  7558.            declarations of variables of this type in the generic body. In Ada 
  7559.            95, to avoid this clear violation of the contract model, the generic 
  7560.            declaration clearly indicates whether or not such instantiations are 
  7561.            permitted. If a generic formal parameter has explicit unknown 
  7562.            discriminants, indicated by using (<>) after the type name, then it 
  7563.            can be instantiated with indefinite types, but no variables can be 
  7564.            declared of this type. Any attempt to declare a variable will result 
  7565.            in an illegality at the time the generic is declared. If the (<>) 
  7566.            notation is not used, then it is illegal to instantiate the generic 
  7567.            with an indefinite type. This will show up as a compile time error, 
  7568.            and the fix is usually simply to add the (<>) to the generic 
  7569.            declaration. 
  7570.  
  7571.  All implementations of GNAT provide a switch that causes GNAT to operate in 
  7572.  Ada 83 mode. In this mode, some but not all compatibility problems of the type 
  7573.  described above are handled automatically. For example, the new Ada 95 
  7574.  protected keywords are not recognized in this mode. However, in practice, it 
  7575.  is usually advisable to make the necessary modifications to the program to 
  7576.  remove the need for using this switch. 
  7577.  
  7578.  
  7579. ΓòÉΓòÉΓòÉ 17.2. Compatibility with Other Ada 95 Systems ΓòÉΓòÉΓòÉ
  7580.  
  7581.  
  7582.  Providing that programs avoid the use of implementation dependent and 
  7583.  implementation defined features of Ada 95, as documented in the Ada 95 
  7584.  reference manual, there should be a high degree of portability between GNAT 
  7585.  and other Ada 95 systems. The following are specific items which have proved 
  7586.  troublesome in moving GNAT programs to other Ada 95 compilers, but do not 
  7587.  affect porting code to GNAT. 
  7588.  
  7589.  Ada 83 Pragmas and Attributes 
  7590.            Ada 95 compilers are allowed, but not required, to implement the 
  7591.            missing Ada 83 pragmas and attributes that are no longer defined in 
  7592.            Ada 95. GNAT implements all such pragmas and attributes, eliminating 
  7593.            this as a compatibility concern, but some other Ada 95 compilers 
  7594.            reject these pragmas and attributes. 
  7595.  
  7596.  Special-needs Annexes 
  7597.            GNAT implements the full set of special needs annexes. At the 
  7598.            current time, it is the only Ada 95 compiler to do so. This means 
  7599.            that programs making use of these features may not be portable to 
  7600.            other Ada 95 compilation systems. 
  7601.  
  7602.  Representation Clauses 
  7603.            Some other Ada 95 compilers implement only the minimal set of 
  7604.            representation clauses required by the Ada 95 reference manual. GNAT 
  7605.            goes far beyond this minimal set, as described in the next section. 
  7606.  
  7607.  
  7608. ΓòÉΓòÉΓòÉ 17.3. Representation Clauses ΓòÉΓòÉΓòÉ
  7609.  
  7610.  
  7611.  The Ada 83 reference manual was quite vague in describing both the minimal 
  7612.  required implementation of representation clauses, and also their precise 
  7613.  effects. The Ada 95 reference manual is much more explicit, but the minimal 
  7614.  set of capabilities required in Ada 95 is quite limited. 
  7615.  
  7616.  GNAT implements the full required set of capabilities described in the Ada 95 
  7617.  reference manual, but also goes much beyond this, and in particular an effort 
  7618.  has been made to be compatible with existing Ada 83 usage to the greatest 
  7619.  extent possible. 
  7620.  
  7621.  A few cases exist in which Ada 83 compiler behavior is incompatible with 
  7622.  requirements in the Ada 95 reference manual. These are instances of 
  7623.  intentional or accidental dependence on specific implementation dependent 
  7624.  characteristics of these Ada 83 compilers. The following is a list of the 
  7625.  cases most likely to arise in existing legacy Ada 83 code. 
  7626.  
  7627.  Implicit Packing 
  7628.            Some Ada 83 compilers allowed a Size specification to cause implicit 
  7629.            packing of an array or record. This is specifically disallowed by 
  7630.            implementation advice in the Ada 83 reference manual (for good 
  7631.            reason, this usage can cause expensive implicit conversions to occur 
  7632.            in the code). The problem will show up as an error message rejecting 
  7633.            the size clause. The fix is simply to provide the explicit pragma 
  7634.            Pack. 
  7635.  
  7636.  Meaning of Size Attribute 
  7637.            The Size attribute in Ada 95 for discrete types is defined as being 
  7638.            the minimal number of bits required to hold values of the type. For 
  7639.            example, on a 32-bit machine, the size of Natural will typically be 
  7640.            31 and not 32 (since no sign bit is required). Some Ada 83 compilers 
  7641.            gave 31, and some 32 in this situation. This problem will usually 
  7642.            show up as a compile time error, but not always. It is a good idea 
  7643.            to check all uses of the 'Size attribute when porting Ada 83 code. 
  7644.            The GNAT specific attribute Object_Size can provide a useful way of 
  7645.            duplicating the behavior of some Ada 83 compiler systems. 
  7646.  
  7647.  Size of Access Types 
  7648.            A common assumption in Ada 83 code is that an access type is in fact 
  7649.            a pointer, and that therefore it will be the same size as a 
  7650.            System.Address value. This assumption is true for GNAT in most cases 
  7651.            with one exception. For the case of a pointer to an unconstrained 
  7652.            array type (where the bounds may vary from one value of the access 
  7653.            type to another), the default is to use a "fat pointer", which is 
  7654.            represented as two separate pointers, one to the bounds, and one to 
  7655.            the array. This representation has a number of advantages, including 
  7656.            improved efficiency. However, it may cause some difficulties in 
  7657.            porting existing Ada 83 code which makes the assumption that, for 
  7658.            example, pointers fit in 32 bits on a machine with 32-bit 
  7659.            addressing. 
  7660.  
  7661.            To get around this problem, GNAT also permits the use of "thin 
  7662.            pointers" for access types in this case (where the designated type 
  7663.            is an unconstrained array type). These thin pointers are indeed the 
  7664.            same size as a System.Address value. To specify a thin pointer, use 
  7665.            a size clause for the type, for example: 
  7666.  
  7667.                       type X is access all String;
  7668.                       for X'Size use System.Address'Size;
  7669.  
  7670.  which will cause the type X to be represented using a single pointer. When 
  7671.  using this representation, the bounds are right behind the array. This 
  7672.  representation is slightly less efficient, and does not allow quite such 
  7673.  flexibility in the use of foreign pointers or in using the Unrestricted_Access 
  7674.  attribute to create pointers to non-aliased objects. But for any standard 
  7675.  portable use of the access type it will work in a functionally correct manner 
  7676.  and allow porting of existing code. Note that another way of forcing a thin 
  7677.  pointer representation is to use a component size clause for the element size 
  7678.  in an array, or a record representation clause for an access field in a 
  7679.  record. 
  7680.  
  7681.  
  7682. ΓòÉΓòÉΓòÉ 17.4. Compatibility with DEC Ada 83 ΓòÉΓòÉΓòÉ
  7683.  
  7684.  
  7685.  The VMS version of GNAT fully implements all the pragmas and attributes 
  7686.  provided by DEC Ada 83, as well as providing the standard DEC Ada 83 
  7687.  libraries, including Starlet. In addition, data layouts and parameter passing 
  7688.  conventions are highly compatible. This means that porting existing DEC Ada 83 
  7689.  code to GNAT in VMS systems should be easier than most other porting efforts. 
  7690.  The following are some of the most significant differences between GNAT and 
  7691.  DEC Ada 83. 
  7692.  
  7693.  Default floating-point representation 
  7694.            In GNAT, the default floating-point format is IEEE, whereas in DEC 
  7695.            Ada 83, it is VMS format. GNAT does implement the necessary pragmas 
  7696.            (Long_Float, Float_Representation) for changing this default. 
  7697.  
  7698.  System 
  7699.            The package System in GNAT exactly corresponds to the definition in 
  7700.            the Ada 95 reference manual, which means that it excludes many of 
  7701.            the DEC Ada 83 extensions. However, a separate package Aux_DEC is 
  7702.            provided that contains the additional definitions, and a special 
  7703.            pragma, Extend_System allows this package to be treated 
  7704.            transparently as an extension of package System. 
  7705.  
  7706.  To_Address 
  7707.            The definitions provided by Aux_DEC are exactly compatible with 
  7708.            those in the DEC Ada 83 version of System, with one exception. DEC 
  7709.            Ada provides the following declarations: 
  7710.  
  7711.                       TO_ADDRESS(INTEGER)
  7712.                       TO_ADDRESS(UNSIGNED_LONGWORD)
  7713.                       TO_ADDRESS(universal_integer)
  7714.  
  7715.  The version of TO_ADDRESS taking a universal integer argument is in fact an 
  7716.  extension to Ada 83 not strictly compatible with the reference manual. In 
  7717.  GNAT, we are constrained to be exactly compatible with the standard, and this 
  7718.  means we cannot provide this capability. In DEC Ada 83, the point of this 
  7719.  definition is to deal with a call like: 
  7720.  
  7721.                         TO_ADDRESS (16#12777#);
  7722.  
  7723.  Normally, according to the Ada 83 standard, one would expect this to be 
  7724.  ambiguous, since it matches both the INTEGER and UNSIGNED_LONGWORD forms of 
  7725.  TO_ADDRESS. However, in DEC Ada 83, there is no ambiguity, since the 
  7726.  definition using universal_integer takes precedence. 
  7727.  
  7728.  In GNAT, since the version with universal_integer cannot be supplied, it is 
  7729.  not possible to be 100% compatible. Since there are many programs using 
  7730.  numeric constants for the argument to TO_ADDRESS, the decision in GNAT was to 
  7731.  change the name of the function in the UNSIGNED_LONGWORD case, so the 
  7732.  declarations provided in the GNAT version of AUX_Dec are: 
  7733.  
  7734.                       function To_Address (X : Integer) return Address;
  7735.                       pragma Pure_Function (To_Address);
  7736.                       function To_Address_Long (X : Unsigned_Longword)
  7737.                        return Address;
  7738.                       pragma Pure_Function (To_Address_Long);
  7739.  
  7740.  This means that programs using TO_ADDRESS for UNSIGNED_LONGWORD must change 
  7741.  the name to TO_ADDRESS_LONG. 
  7742.  
  7743.  Task_Id values 
  7744.            The Task_Id values assigned will be different in the two systems, 
  7745.            and GNAT does not provide a specified value for the Task_Id of the 
  7746.            environment task, which in GNAT is treated like any other declared 
  7747.            task. 
  7748.  
  7749.  For full details on these and other less significant compatibility issues, see 
  7750.  appendix E of the Digital publication entitled "DEC Ada, Technical Overview 
  7751.  and Comparison on DIGITAL Platforms". 
  7752.  
  7753.  For GNAT running on other than VMS systems, all the DEC Ada 83 pragmas and 
  7754.  attributes are recognized, although only a subset of them can sensibly be 
  7755.  implemented. The description of pragmas in this reference manual indicates 
  7756.  whether or not they are applicable to non-VMS systems. 
  7757.  
  7758.  
  7759. ΓòÉΓòÉΓòÉ 18. Index ΓòÉΓòÉΓòÉ
  7760.  
  7761.  -gnatR switch                                     Determining the 
  7762.                                                    Representations chosen by 
  7763.                                                    GNAT 
  7764.  Access, unrestricted                              Implementation Defined 
  7765.                                                    Attributes 
  7766.  Accuracy requirements                             Implementation Advice 
  7767.  Accuracy, complex arithmetic                      Implementation Advice 
  7768.  Ada 83 attributes                                 Implementation Defined 
  7769.                                                    Attributes 
  7770.                                                    Implementation Defined 
  7771.                                                    Attributes 
  7772.                                                    Implementation Defined 
  7773.                                                    Attributes 
  7774.                                                    Implementation Defined 
  7775.                                                    Attributes 
  7776.                                                    Implementation Defined 
  7777.                                                    Attributes 
  7778.                                                    Implementation Defined 
  7779.                                                    Attributes 
  7780.                                                    Implementation Defined 
  7781.                                                    Attributes 
  7782.                                                    Implementation Defined 
  7783.                                                    Attributes 
  7784.  Ada 95 ISO/ANSI Standard                          What This Reference Manual 
  7785.                                                    Contains 
  7786.  Address Clause                                    Address Clauses 
  7787.  Address clauses                                   Implementation Advice 
  7788.  Address of subprogram code                        Implementation Defined 
  7789.                                                    Attributes 
  7790.  Address, as private type                          Implementation Advice 
  7791.  Address, operations of                            Implementation Advice 
  7792.  Alignment Clause                                  Alignment Clauses 
  7793.  Alignment clauses                                 Implementation Advice 
  7794.  Alignment, default                                Alignment Clauses 
  7795.  Alignment, maximum                                Implementation Defined 
  7796.                                                    Attributes 
  7797.  Alignments of components                          Implementation Defined 
  7798.                                                    Pragmas 
  7799.  Alternative Character Sets                        Implementation Advice 
  7800.  Argument passing mechanisms                       Implementation Defined 
  7801.                                                    Pragmas 
  7802.  Arrays, extendable                                GNAT.Table (g-table.ads) 
  7803.  Arrays, multidimensional                          Implementation Advice 
  7804.  Biased representation                             Biased Representation 
  7805.  Big endian                                        Implementation Defined 
  7806.                                                    Attributes 
  7807.  Bit ordering                                      Implementation Advice 
  7808.  Bit_Order Clause                                  Bit_Order Clauses 
  7809.  Bounded errors                                    Implementation Advice 
  7810.  Bounded-length strings                            Implementation Advice 
  7811.  C, interfacing with                               Implementation Advice 
  7812.  Calendar                                          GNAT.Calendar (g-calend.ads) 
  7813.                                                    GNAT.Calendar.Time_IO 
  7814.                                                    (g-catiio.ads) 
  7815.  Casing of External names                          Implementation Defined 
  7816.                                                    Pragmas 
  7817.  Casing utilities                                  GNAT.Case_Util (g-casuti) 
  7818.  Character Sets                                    Implementation Advice 
  7819.  Checks, suppression of                            Implementation Advice 
  7820.  Child Units                                       Implementation Advice 
  7821.  COBOL support                                     Implementation Advice 
  7822.  COBOL, interfacing with                           Implementation Advice 
  7823.  Command line                                      GNAT.Command_Line 
  7824.                                                    (g-comlin.ads) 
  7825.  Complex arithmetic accuracy                       Implementation Advice 
  7826.  Complex elementary functions                      Implementation Advice 
  7827.  Complex types                                     Implementation Advice 
  7828.  Component Clause                                  Record Representation 
  7829.                                                    Clauses 
  7830.  Component_Size Clause                             Component_Size Clauses 
  7831.  Component_Size clauses                            Implementation Advice 
  7832.  Convention, effect on representation              Effect of Convention on 
  7833.                                                    Representation 
  7834.  Conventions, typographical                        Conventions 
  7835.  Current exception                                 GNAT.Current_Exception 
  7836.                                                    (g-curexc.ads) 
  7837.  Debugging                                         GNAT.Debug_Pools 
  7838.                                                    (g-debpoo.ads) 
  7839.                                                    GNAT.Debug_Utilities 
  7840.                                                    (g-debuti.ads) 
  7841.  Dec Ada 83                                        Implementation Defined 
  7842.                                                    Pragmas 
  7843.  Dec Ada 83 casing compatibility                   Implementation Defined 
  7844.                                                    Pragmas 
  7845.  Decimal radix support                             Implementation Advice 
  7846.  Deferring aborts                                  Implementation Defined 
  7847.                                                    Pragmas 
  7848.  Directory operations                              GNAT.Directory_Operations 
  7849.                                                    (g-dirope.ads) 
  7850.  Discriminants, testing for                        Implementation Defined 
  7851.                                                    Attributes 
  7852.  Elimination of unused subprograms                 Implementation Defined 
  7853.                                                    Pragmas 
  7854.  Entry queuing policies                            Implementation Advice 
  7855.  Enumeration representation clauses                Implementation Advice 
  7856.  Enumeration values                                Implementation Advice 
  7857.  Error detection                                   Implementation Advice 
  7858.  Exception information                             Implementation Advice 
  7859.  Exception retrieval                               GNAT.Current_Exception 
  7860.                                                    (g-curexc.ads) 
  7861.  External Names, casing                            Implementation Defined 
  7862.                                                    Pragmas 
  7863.  File locking                                      GNAT.Lock_Files 
  7864.                                                    (g-locfil.ads) 
  7865.  Float types                                       Implementation Advice 
  7866.  Floating-Point Processor                          GNAT.Float_Control 
  7867.                                                    (g-flocon.ads) 
  7868.  Foreign threads                                   GNAT.Threads (g-thread.ads) 
  7869.  Fortran, interfacing with                         Implementation Advice 
  7870.  Get_Immediate                                     Get_Immediate 
  7871.  GNAT.Bubble_Sort_A (g-busora.ads)                 GNAT.Bubble_Sort_A 
  7872.                                                    (g-busora.ads) 
  7873.  GNAT.Bubble_Sort_G (g-busorg.ads)                 GNAT.Bubble_Sort_G 
  7874.                                                    (g-busorg.ads) 
  7875.  GNAT.Calendar (g-calend.ads)                      GNAT.Calendar (g-calend.ads) 
  7876.  GNAT.Calendar.Time_IO (g-catiio.ads)              GNAT.Calendar.Time_IO 
  7877.                                                    (g-catiio.ads) 
  7878.  GNAT.Case_Util (g-casuti)                         GNAT.Case_Util (g-casuti) 
  7879.  GNAT.Command_Line (g-comlin.ads)                  GNAT.Command_Line 
  7880.                                                    (g-comlin.ads) 
  7881.  GNAT.Current_Exception (g-curexc.ads)             GNAT.Current_Exception 
  7882.                                                    (g-curexc.ads) 
  7883.  GNAT.Debug_Pools (g-debpoo.ads)                   GNAT.Debug_Pools 
  7884.                                                    (g-debpoo.ads) 
  7885.  GNAT.Debug_Utilities (g-debuti.ads)               GNAT.Debug_Utilities 
  7886.                                                    (g-debuti.ads) 
  7887.  GNAT.Directory_Operations (g-dirope.ads)          GNAT.Directory_Operations 
  7888.                                                    (g-dirope.ads) 
  7889.  GNAT.Float_Control (g-flocon.ads)                 GNAT.Float_Control 
  7890.                                                    (g-flocon.ads) 
  7891.  GNAT.Heap_Sort_A (g-hesora.ads)                   GNAT.Heap_Sort_A 
  7892.                                                    (g-hesora.ads) 
  7893.  GNAT.Heap_Sort_G (g-hesorg.ads)                   GNAT.Heap_Sort_G 
  7894.                                                    (g-hesorg.ads) 
  7895.  GNAT.HTable (g-htable.ads)                        GNAT.HTable (g-htable.ads) 
  7896.  GNAT.IO (g-io.ads)                                GNAT.IO (g-io.ads) 
  7897.  GNAT.IO_Aux (g-io_aux.ads)                        GNAT.IO_Aux (g-io_aux.ads) 
  7898.  GNAT.Lock_Files (g-locfil.ads)                    GNAT.Lock_Files 
  7899.                                                    (g-locfil.ads) 
  7900.  GNAT.OS_Lib (g-os_lib.ads)                        GNAT.OS_Lib (g-os_lib.ads) 
  7901.  GNAT.Regexp (g-regexp.ads)                        GNAT.Regexp (g-regexp.ads) 
  7902.  GNAT.Regpat (g-regpat.ads)                        GNAT.Regpat (g-regpat.ads) 
  7903.  GNAT.Spell_Checker (g-speche.ads)                 GNAT.Spell_Checker 
  7904.                                                    (g-speche.ads) 
  7905.  GNAT.Spitbol (g-spitbo.ads)                       GNAT.Spitbol (g-spitbo.ads) 
  7906.  GNAT.Spitbol.Patterns (g-spipat.ads)              GNAT.Spitbol.Patterns 
  7907.                                                    (g-spipat.ads) 
  7908.  GNAT.SPITBOL.Table_Boolean (g-sptabo.ads)         GNAT.SPITBOL.Table_Boolean 
  7909.                                                    (g-sptabo.ads) 
  7910.  GNAT.SPITBOL.Table_Integer (g-sptain.ads)         GNAT.SPITBOL.Table_Integer 
  7911.                                                    (g-sptain.ads) 
  7912.  GNAT.SPITBOL.Table_VString (g-sptavs.ads)         GNAT.SPITBOL.Table_VString 
  7913.                                                    (g-sptavs.ads) 
  7914.  GNAT.Table (g-table.ads)                          GNAT.Table (g-table.ads) 
  7915.  GNAT.Task_Lock (g-tasloc.ads)                     GNAT.Task_Lock 
  7916.                                                    (g-tasloc.ads) 
  7917.  GNAT.Threads (g-thread.ads)                       GNAT.Threads (g-thread.ads) 
  7918.  GNAT.Traceback (g-traceb.ads)                     GNAT.Traceback 
  7919.                                                    (g-traceb.ads) 
  7920.  GNAT.Traceback.Symbolic (g-trasym.ads)            GNAT.Traceback.Symbolic 
  7921.                                                    (g-trasym.ads) 
  7922.  Hash tables                                       GNAT.HTable (g-htable.ads) 
  7923.  Heap usage, implicit                              Implementation Advice 
  7924.  Implementation-dependent features                 About This Guide 
  7925.  Initialization, suppression of                    Implementation Defined 
  7926.                                                    Pragmas 
  7927.  Input/Output facilities                           GNAT.IO (g-io.ads) 
  7928.                                                    GNAT.IO_Aux (g-io_aux.ads) 
  7929.  Integer maps                                      GNAT.SPITBOL.Table_Integer 
  7930.                                                    (g-sptain.ads) 
  7931.  Integer types                                     Implementation Advice 
  7932.  Interfacing to C++                                Implementation Defined 
  7933.                                                    Pragmas 
  7934.  Interfacing with C++                              Implementation Defined 
  7935.                                                    Pragmas 
  7936.                                                    Implementation Defined 
  7937.                                                    Pragmas 
  7938.                                                    Implementation Defined 
  7939.                                                    Pragmas 
  7940.  Interrupt priority, maximum                       Implementation Defined 
  7941.                                                    Attributes 
  7942.  Interrupt support                                 Implementation Advice 
  7943.  Little endian                                     Implementation Defined 
  7944.                                                    Attributes 
  7945.  Locking                                           GNAT.Task_Lock 
  7946.                                                    (g-tasloc.ads) 
  7947.  Locking Policies                                  Implementation Advice 
  7948.  Locking using files                               GNAT.Lock_Files 
  7949.                                                    (g-locfil.ads) 
  7950.  Machine operations                                Implementation Advice 
  7951.  Maps                                              GNAT.SPITBOL.Table_Integer 
  7952.                                                    (g-sptain.ads) 
  7953.                                                    GNAT.SPITBOL.Table_VString 
  7954.                                                    (g-sptavs.ads) 
  7955.  Multidimensional arrays                           Implementation Advice 
  7956.  Named numbers, representation of                  Implementation Defined 
  7957.                                                    Attributes 
  7958.  Numerics                                          Implementation Advice 
  7959.  OpenVMS                                           Implementation Defined 
  7960.                                                    Pragmas 
  7961.                                                    Implementation Defined 
  7962.                                                    Pragmas 
  7963.                                                    Implementation Defined 
  7964.                                                    Pragmas 
  7965.                                                    Implementation Defined 
  7966.                                                    Pragmas 
  7967.                                                    Implementation Defined 
  7968.                                                    Pragmas 
  7969.                                                    Implementation Defined 
  7970.                                                    Pragmas 
  7971.                                                    Implementation Defined 
  7972.                                                    Pragmas 
  7973.                                                    Implementation Defined 
  7974.                                                    Pragmas 
  7975.                                                    Implementation Defined 
  7976.                                                    Pragmas 
  7977.                                                    Implementation Defined 
  7978.                                                    Pragmas 
  7979.                                                    Implementation Defined 
  7980.                                                    Pragmas 
  7981.                                                    Implementation Defined 
  7982.                                                    Attributes 
  7983.                                                    Implementation Defined 
  7984.                                                    Attributes 
  7985.  Operating System interface                        GNAT.OS_Lib (g-os_lib.ads) 
  7986.  Operations, on Address                            Implementation Advice 
  7987.  Package Interfaces                                Implementation Advice 
  7988.  Package Interrupts                                Implementation Advice 
  7989.  Package Task_Attributes                           Implementation Advice 
  7990.  Packed types                                      Implementation Advice 
  7991.  Parameters, passing mechanism                     Implementation Defined 
  7992.                                                    Attributes 
  7993.  Parameters, when passed by reference              Implementation Defined 
  7994.                                                    Attributes 
  7995.  Partition communication subsystem                 Implementation Advice 
  7996.  Passing by copy                                   Implementation Defined 
  7997.                                                    Pragmas 
  7998.  Passing by descriptor                             Implementation Defined 
  7999.                                                    Pragmas 
  8000.                                                    Implementation Defined 
  8001.                                                    Pragmas 
  8002.  Patterm matching                                  GNAT.Spitbol.Patterns 
  8003.                                                    (g-spipat.ads) 
  8004.  Pattern matching                                  GNAT.Regexp (g-regexp.ads) 
  8005.                                                    GNAT.Regpat (g-regpat.ads) 
  8006.  PCS                                               Implementation Advice 
  8007.  Portability                                       About This Guide 
  8008.  Pragma Pack (for arrays)                          Pragma Pack for Arrays 
  8009.  Pragma Pack (for records)                         Pragma Pack for Records 
  8010.  Pragma, representation                            Representation Clauses and 
  8011.                                                    Pragmas 
  8012.  Pragmas                                           Implementation Advice 
  8013.  Pre-elaboration requirements                      Implementation Advice 
  8014.  Preemptive abort                                  Implementation Advice 
  8015.  Priority, maximum                                 Implementation Defined 
  8016.                                                    Attributes 
  8017.  Protected procedure handlers                      Implementation Advice 
  8018.  Random number generation                          Implementation Advice 
  8019.  Record Representation Clause                      Record Representation 
  8020.                                                    Clauses 
  8021.  Record representation clauses                     Implementation Advice 
  8022.  Regular expressions                               GNAT.Regexp (g-regexp.ads) 
  8023.                                                    GNAT.Regpat (g-regpat.ads) 
  8024.  Representation Clause                             Representation Clauses and 
  8025.                                                    Pragmas 
  8026.  Representation clauses                            Implementation Advice 
  8027.                                                    Representation Clauses and 
  8028.                                                    Pragmas 
  8029.  Representation clauses, enumeration               Implementation Advice 
  8030.  Representation clauses, records                   Implementation Advice 
  8031.  Representation of enums                           Implementation Defined 
  8032.                                                    Attributes 
  8033.  Representation Pragma                             Representation Clauses and 
  8034.                                                    Pragmas 
  8035.  Representation, determination of                  Determining the 
  8036.                                                    Representations chosen by 
  8037.                                                    GNAT 
  8038.  Return values, passing mechanism                  Implementation Defined 
  8039.                                                    Attributes 
  8040.  Sets of strings                                   GNAT.SPITBOL.Table_Boolean 
  8041.                                                    (g-sptabo.ads) 
  8042.  Simple I/O                                        GNAT.IO (g-io.ads) 
  8043.  Size Clause                                       Size Clauses 
  8044.  Size clauses                                      Implementation Advice 
  8045.  Size for biased representation                    Biased Representation 
  8046.  Size of Address                                   Implementation Defined 
  8047.                                                    Attributes 
  8048.  Size, of objects                                  Value_Size and Object_Size 
  8049.                                                    Clauses 
  8050.  Size, setting for not-first subtype               Implementation Defined 
  8051.                                                    Attributes 
  8052.  Size, used for objects                            Implementation Defined 
  8053.                                                    Attributes 
  8054.  Size, VADS compatibility                          Implementation Defined 
  8055.                                                    Pragmas 
  8056.                                                    Implementation Defined 
  8057.                                                    Attributes 
  8058.  Sorting                                           GNAT.Bubble_Sort_A 
  8059.                                                    (g-busora.ads) 
  8060.                                                    GNAT.Bubble_Sort_G 
  8061.                                                    (g-busorg.ads) 
  8062.                                                    GNAT.Heap_Sort_A 
  8063.                                                    (g-hesora.ads) 
  8064.                                                    GNAT.Heap_Sort_G 
  8065.                                                    (g-hesorg.ads) 
  8066.  Spawn capability                                  GNAT.OS_Lib (g-os_lib.ads) 
  8067.  Spell checking                                    GNAT.Spell_Checker 
  8068.                                                    (g-speche.ads) 
  8069.  SPITBOL interface                                 GNAT.Spitbol (g-spitbo.ads) 
  8070.  SPITBOL pattern matching                          GNAT.Spitbol.Patterns 
  8071.                                                    (g-spipat.ads) 
  8072.  SPITBOL Tables                                    GNAT.SPITBOL.Table_Boolean 
  8073.                                                    (g-sptabo.ads) 
  8074.                                                    GNAT.SPITBOL.Table_Integer 
  8075.                                                    (g-sptain.ads) 
  8076.                                                    GNAT.SPITBOL.Table_VString 
  8077.                                                    (g-sptavs.ads) 
  8078.  Storage place attributes                          Implementation Advice 
  8079.  Stream files                                      Treating Text_IO Files as 
  8080.                                                    Streams 
  8081.  Stream oriented attributes                        Implementation Advice 
  8082.  String maps                                       GNAT.SPITBOL.Table_VString 
  8083.                                                    (g-sptavs.ads) 
  8084.  Subprogram address                                Implementation Defined 
  8085.                                                    Attributes 
  8086.  Suppressing initialization                        Implementation Defined 
  8087.                                                    Pragmas 
  8088.  Suppression of checks                             Implementation Advice 
  8089.  system, extending                                 Implementation Defined 
  8090.                                                    Pragmas 
  8091.  Table implementation                              GNAT.Table (g-table.ads) 
  8092.  Task locking                                      GNAT.Task_Lock 
  8093.                                                    (g-tasloc.ads) 
  8094.  Task synchronization                              GNAT.Task_Lock 
  8095.                                                    (g-tasloc.ads) 
  8096.  Tasking restrictions                              Implementation Advice 
  8097.  Text_IO                                           GNAT.IO_Aux (g-io_aux.ads) 
  8098.  Text_IO extensions                                Text_IO Extensions 
  8099.  Text_IO for unbounded strings                     Text_IO Facilities for 
  8100.                                                    Unbounded Strings 
  8101.  Threads, foreign                                  GNAT.Threads (g-thread.ads) 
  8102.  Time                                              GNAT.Calendar.Time_IO 
  8103.                                                    (g-catiio.ads) 
  8104.  Time, monotonic                                   Implementation Advice 
  8105.  Trace back facilities                             GNAT.Traceback 
  8106.                                                    (g-traceb.ads) 
  8107.                                                    GNAT.Traceback.Symbolic 
  8108.                                                    (g-trasym.ads) 
  8109.  Typographical conventions                         Conventions 
  8110.  Unbounded_String, Text_IO operations              Text_IO Facilities for 
  8111.                                                    Unbounded Strings 
  8112.  Unchecked conversion                              Implementation Advice 
  8113.  Unchecked deallocation                            Implementation Advice 
  8114.  Unions in C                                       Implementation Defined 
  8115.                                                    Pragmas 
  8116.  Zero address, passing                             Implementation Defined 
  8117.                                                    Attributes 
  8118.  Zero Cost Exceptions                              Implementation Defined 
  8119.                                                    Pragmas 
  8120.