home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / ada / referenc / book / chap13.doc < prev    next >
Text File  |  1988-11-08  |  48KB  |  1,139 lines

  1.      13. Representation Clauses and Implementation-Dependent Features
  2.  
  3.  
  4. This      chapter     describes     representation     clauses,     certain
  5. implementation-dependent features, and other  features  that  are  used  in
  6. system programming.
  7.  
  8. 13.1  Representation Clauses
  9.  
  10.  
  11. Representation  clauses  specify  how  the  types of the language are to be
  12. mapped onto the underlying machine.  They can  be  provided  to  give  more
  13. efficient representation or to interface with features that are outside the
  14. domain of the language (for example, peripheral hardware).
  15.  
  16.  
  17.     representation_clause ::=
  18.          type_representation_clause | address_clause
  19.  
  20.     type_representation_clause ::= length_clause
  21.        | enumeration_representation_clause | record_representation_clause
  22.  
  23.  
  24. A  type  representation clause applies either to a type or to a first named
  25. subtype (that is, to a subtype declared by a  type  declaration,  the  base
  26. type  being  therefore anonymous).  Such a representation clause applies to
  27. all objects that have this type or this first named subtype.  At  most  one
  28. enumeration  or  record  representation clause is allowed for a given type:
  29. an enumeration representation clause is only  allowed  for  an  enumeration
  30. type;   a  record  representation  clause, only for a record type.  (On the
  31. other hand, more than one length clause can be provided for a  given  type;
  32. moreover,  both a length clause and an enumeration or record representation
  33. clause  can  be  provided.)   A  length  clause  is  the   only   form   of
  34. representation  clause  allowed  for a type derived from a parent type that
  35. has (user-defined) derivable subprograms.
  36.  
  37.  
  38. An address clause applies either to an object;  to a  subprogram,  package,
  39. or  task  unit;  or to an entry.  At most one address clause is allowed for
  40. any of these entities.
  41.  
  42.  
  43. A representation clause and the declaration of  the  entity  to  which  the
  44. clause  applies  must  both  occur  immediately within the same declarative
  45. part, package specification, or task specification;  the  declaration  must
  46. occur  before  the clause.  In the absence of a representation clause for a
  47. given  declaration,  a  default  representation  of  this  declaration   is
  48. determined  by  the implementation.  Such a default determination occurs no
  49. later than the end of the immediately enclosing declarative  part,  package
  50. specification,  or  task  specification.   For  a  declaration  given  in a
  51. declarative part, this default determination  occurs  before  any  enclosed
  52. body.
  53.  
  54.  
  55. In  the  case  of  a  type,  certain occurrences of its name imply that the
  56. representation of the type must already have been determined.  Consequently
  57. these occurrences force the default determination  of  any  aspect  of  the
  58. representation  not  already  determined  by  a  prior  type representation
  59. clause.  This default determination is also forced by  similar  occurrences
  60. of the name of a subtype of the type, or of the name of any type or subtype
  61. that has subcomponents of the type.  A forcing occurrence is any occurrence
  62. other than in a type or subtype declaration, a subprogram specification, an
  63. entry  declaration,  a  deferred  constant  declaration,  a  pragma,  or  a
  64. representation clause for the type itself.   In  any  case,  an  occurrence
  65. within an expression is always forcing.
  66.  
  67.  
  68. A  representation  clause  for  a  given  entity  must  not appear after an
  69. occurrence of the name of the entity if this occurrence  forces  a  default
  70. determination of representation for the entity.
  71.  
  72.  
  73. Similar  restrictions  exist  for  address  clauses.   For  an  object, any
  74. occurrence of  its  name  (after  the  object  declaration)  is  a  forcing
  75. occurrence.  For a subprogram, package, task unit, or entry, any occurrence
  76. of a representation attribute of such an entity is a forcing occurrence.
  77.  
  78.  
  79. The  effect  of the elaboration of a representation clause is to define the
  80. corresponding aspects of the representation.
  81.  
  82.  
  83. The interpretation of some of the expressions that appear in representation
  84. clauses is implementation-dependent, for  example,  expressions  specifying
  85. addresses.   An  implementation  may limit its acceptance of representation
  86. clauses to those that can be handled simply by the underlying hardware.  If
  87. a representation clause is accepted by an implementation, the compiler must
  88. guarantee that the net effect of the program is not changed by the presence
  89. of the clause, except for address clauses and for parts of the program that
  90. interrogate  representation  attributes.    If   a   program   contains   a
  91. representation  clause  that  is not accepted, the program is illegal.  For
  92. each  implementation,  the  allowed   representation   clauses,   and   the
  93. conventions   used   for   implementation-dependent  expressions,  must  be
  94. documented in Appendix F of the reference manual.
  95.  
  96.  
  97. Whereas a representation clause is used to impose  certain  characteristics
  98. of  the  mapping   of an entity onto the underlying machine, pragmas can be
  99. used to provide an implementation with criteria for its selection of such a
  100. mapping.  The pragma PACK specifies that storage minimization should be the
  101. main criterion when selecting the representation of a record or array type.
  102. Its form is as follows:
  103.  
  104.     pragma PACK(type_simple_name);
  105.  
  106.  
  107. Packing means that gaps between the storage areas allocated to  consecutive
  108. components  should  be minimized.  It need not, however, affect the mapping
  109. of each component onto storage.  This mapping can itself be influenced by a
  110. pragma (or controlled by a representation  clause)  for  the  component  or
  111. component type.  The position of a PACK pragma, and the restrictions on the
  112. named  type, are governed by the same rules as for a representation clause;
  113. in particular, the pragma must appear before any use  of  a  representation
  114. attribute of the packed entity.
  115.  
  116.  
  117. The  pragma  PACK  is  the  only  language-defined  representation  pragma.
  118. Additional representation pragmas may be  provided  by  an  implementation;
  119. these  must  be  documented  in Appendix F.  (In contrast to representation
  120. clauses, a pragma that is not accepted by the implementation  is  ignored.)
  121.  
  122. Note:
  123.  
  124.  
  125. No representation clause is allowed for a generic formal type.
  126.  
  127.  
  128. References:   address  clause  13.5,  allow  1.6,  body 3.9, component 3.3,
  129. declaration 3.1, declarative part 3.9, default expression  3.2.1,  deferred
  130. constant  declaration  7.4,  derivable  subprogram  3.4,  derived type 3.4,
  131. entity 3.1, entry 9.5, enumeration representation clause  13.3,  expression
  132. 4.4, generic formal type 12.1.2, illegal 1.6, length clause 13.2, must 1.6,
  133. name  4.1,  object  3.2,  occur  immediately within 8.1, package 7, package
  134. specification 7.1, parent  type  3.4,  pragma  2.8,  record  representation
  135. clause  13.4,  representation  attribute  13.7.2  13.7.3, subcomponent 3.3,
  136. subprogram 6, subtype 3.3, subtype declaration  3.3.2,  task  specification
  137. 9.1, task unit 9, type 3.3, type declaration 3.3.1
  138.  
  139. 13.2  Length Clauses
  140.  
  141.  
  142. A length clause specifies an amount of storage associated with a type.
  143.  
  144.  
  145.     length_clause ::= for attribute use simple_expression;
  146.  
  147.  
  148. The  expression  must  be  of some numeric type and is evaluated during the
  149. elaboration of the length clause (unless it is a static  expression).   The
  150. prefix of the attribute must denote either a type or a first named subtype.
  151. The  prefix  is  called  T  in  what  follows.   The only allowed attribute
  152. designators in a length clause are  SIZE,  STORAGE_SIZE,  and  SMALL.   The
  153. effect of the length clause depends on the attribute designator:
  154.  
  155.  
  156. (a)  Size specification:  T'SIZE
  157.  
  158.  
  159.      The  expression must be a static expression of some integer type.  The
  160.      value of the expression specifies an upper bound  for  the  number  of
  161.      bits  to be allocated to objects of the type or first named subtype T.
  162.      The  size  specification  must  allow  for  enough  storage  space  to
  163.      accommodate   every   allowable   value  of  these  objects.   A  size
  164.      specification for a composite type may affect the  size  of  the  gaps
  165.      between the storage areas allocated to consecutive components.  On the
  166.      other  hand, it need not affect the size of the storage area allocated
  167.      to each component.
  168.  
  169.  
  170.      The size specification is only allowed if the constraints on T and  on
  171.      its   subcomponents   (if   any)  are  static.   In  the  case  of  an
  172.      unconstrained array type, the index subtypes must also be static.
  173.  
  174.  
  175. (b)  Specification of collection size:  T'STORAGE_SIZE
  176.  
  177.  
  178.      The prefix T must denote an access type.  The expression  must  be  of
  179.      some  integer  type (but need not be static);  its value specifies the
  180.      number of storage units to be reserved for the  collection,  that  is,
  181.      the  storage  space needed to contain all objects designated by values
  182.      of the access type and by values  of  other  types  derived  from  the
  183.      access  type,  directly  or indirectly.  This form of length clause is
  184.      not allowed for a type derived from an access type.
  185.  
  186.  
  187. (c)  Specification of storage for a task activation:  T'STORAGE_SIZE
  188.  
  189.  
  190.      The prefix T must denote a task type.  The expression must be of  some
  191.      integer type (but need not be static);  its value specifies the number
  192.      of  storage units to be reserved for an activation (not the code) of a
  193.      task of the type.
  194.  
  195.  
  196. (d)  Specification of small for a fixed point type:  T'SMALL
  197.  
  198.  
  199.      The prefix T must denote the first named  subtype  of  a  fixed  point
  200.      type.   The  expression must be a static expression of some real type;
  201.      its value must not be greater  than  the  delta  of  the  first  named
  202.      subtype.   The  effect  of  the  length clause is to use this value of
  203.      small for the representation of values of the fixed point  base  type.
  204.      (The  length  clause  thereby  also  affects the amount of storage for
  205.      objects that have this type.)
  206.  
  207. Notes:
  208.  
  209.  
  210. A size specification is allowed for an access, task, or fixed  point  type,
  211. whether or not another form of length clause is also given for the type.
  212.  
  213.  
  214. What  is  considered to be part of the storage reserved for a collection or
  215. for an activation of  a  task  is  implementation-dependent.   The  control
  216. afforded  by  length  clauses  is  therefore relative to the implementation
  217. conventions.  For example, the language does not define whether the storage
  218. reserved for an activation of a task includes any storage  needed  for  the
  219. collection  associated  with  an access type declared within the task body.
  220. Neither does it define the method of  allocation  for  objects  denoted  by
  221. values  of  an access type.  For example, the space allocated could be on a
  222. stack;  alternatively,   a  general  dynamic  allocation  scheme  or  fixed
  223. storage could be used.
  224.  
  225.  
  226. The  objects  allocated  in a collection need not have the same size if the
  227. designated type is an unconstrained array type  or  an  unconstrained  type
  228. with  discriminants.   Note also that the allocator itself may require some
  229. space for internal tables  and  links.   Hence  a  length  clause  for  the
  230. collection  of an access type does not always give precise control over the
  231. maximum number of allocated objects.
  232.  
  233.  
  234. Examples:
  235.  
  236.     --  assumed declarations:
  237.  
  238.     type MEDIUM is range 0 .. 65000;
  239.     type SHORT  is delta 0.01 range -100.0 .. 100.0;
  240.     type DEGREE is delta 0.1  range -360.0 .. 360.0;
  241.  
  242.     BYTE : constant := 8;
  243.     PAGE : constant := 2000;
  244.  
  245.     --  length clauses:
  246.  
  247.     for COLOR'SIZE  use 1*BYTE;  --  see 3.5.1
  248.     for MEDIUM'SIZE use 2*BYTE;
  249.     for SHORT'SIZE  use 15;
  250.  
  251.     for CAR_NAME'STORAGE_SIZE use  --  approximately 2000 cars
  252.                 2000*((CAR'SIZE/SYSTEM.STORAGE_UNIT) + 1);
  253.  
  254.     for KEYBOARD_DRIVER'STORAGE_SIZE use 1*PAGE;
  255.  
  256.     for DEGREE'SMALL use 360.0/2**(SYSTEM.STORAGE_UNIT - 1);
  257.  
  258. Notes on the examples:
  259.  
  260.  
  261. In the length clause for SHORT, fifteen  bits  is  the  minimum  necessary,
  262. since   the   type   definition   requires   SHORT'SMALL  =  2.0**(-7)  and
  263. SHORT'MANTISSA = 14.  The length clause for DEGREE forces the model numbers
  264. to exactly span the range of the type.
  265.  
  266.  
  267. References:  access type 3.8, allocator 4.8, allow  1.6,  array  type  3.6,
  268. attribute  4.1.4, collection 3.8, composite type 3.3, constraint 3.3, delta
  269. of a fixed point type 3.5.9, derived type 3.4, designate  3.8,  elaboration
  270. 3.9,  entity 3.1, evaluation 4.5, expression 4.4, first named subtype 13.1,
  271. fixed point type 3.5.9, index subtype 3.6, integer type  3.5.4,  must  1.6,
  272. numeric  type 3.5, object 3.2, real type 3.5.6, record type 3.7, small of a
  273. fixed point type 3.5.10, static  constraint  4.9,  static  expression  4.9,
  274. static  subtype  4.9,  storage  unit 13.7, subcomponent 3.3, system package
  275. 13.7, task 9, task activation 9.3, task specification 9.1, task  type  9.2,
  276. type 3.3, unconstrained array type 3.6
  277.  
  278. 13.3  Enumeration Representation Clauses
  279.  
  280.  
  281. An  enumeration  representation clause specifies the internal codes for the
  282. literals of the enumeration type that is named in the clause.
  283.  
  284.  
  285.     enumeration_representation_clause ::= for type_simple_name use aggregate;
  286.  
  287.  
  288. The aggregate used to specify this mapping is written as a  one-dimensional
  289. aggregate,  for  which  the  index  subtype is the enumeration type and the
  290. component type is universal_integer.
  291.  
  292.  
  293. All literals of the enumeration type must be provided with distinct integer
  294. codes, and all choices and component values given in the aggregate must  be
  295. static.   The integer codes specified for the enumeration type must satisfy
  296. the predefined ordering relation of the type.
  297.  
  298.  
  299. Example:
  300.  
  301.     type MIX_CODE is (ADD, SUB, MUL, LDA, STA, STZ);
  302.  
  303.     for MIX_CODE use
  304.        (ADD => 1, SUB => 2, MUL => 3, LDA => 8, STA => 24, STZ => 33);
  305.  
  306. Notes:
  307.  
  308.  
  309. The attributes SUCC, PRED, and POS are defined even for  enumeration  types
  310. with  a  noncontiguous representation;  their definition corresponds to the
  311. (logical)  type  declaration  and  is  not  affected  by  the   enumeration
  312. representation  clause.   In  the example, because of the need to avoid the
  313. omitted  values,  these  functions  are  likely  to  be  less   efficiently
  314. implemented  than  they could be in the absence of a representation clause.
  315. Similar considerations apply when such types are used for indexing.
  316.  
  317.  
  318. References:   aggregate  4.3,  array  aggregate  4.3.2,  array  type   3.6,
  319. attribute  of  an  enumeration  type  3.5.5,  choice  3.7.3, component 3.3,
  320. enumeration literal 3.5.1, enumeration type 3.5.1, function 6.5, index 3.6,
  321. index subtype 3.6, literal 4.2, ordering relation of  an  enumeration  type
  322. 3.5.1,  representation clause 13.1, simple name 4.1, static expression 4.9,
  323. type 3.3, type declaration 3.3.1, universal_integer type 3.5.4
  324.  
  325. 13.4  Record Representation Clauses
  326.  
  327.  
  328. A record representation clause  specifies  the  storage  representation  of
  329. records,  that  is,  the  order,  position,  and  size of record components
  330. (including discriminants, if any).
  331.  
  332.  
  333.     record_representation_clause ::=
  334.        for type_simple_name use
  335.           record [alignment_clause]
  336.              {component_clause}
  337.           end record;
  338.  
  339.     alignment_clause ::= at mod static_simple_expression;
  340.  
  341.     component_clause ::=
  342.        component_name at static_simple_expression range static_range;
  343.  
  344.  
  345. The simple expression given after the reserved words at mod in an alignment
  346. clause, or after the reserved word at in a  component  clause,  must  be  a
  347. static  expression  of  some integer type.  If the bounds of the range of a
  348. component clause are defined by simple expressions, then each bound of  the
  349. range  must be defined by a static expression of some integer type, but the
  350. two bounds need not have the same integer type.
  351.  
  352.  
  353. An alignment clause forces each record of the given type to be allocated at
  354. a starting address that is a multiple of the value of the given  expression
  355. (that   is,   the   address  modulo  the  expression  must  be  zero).   An
  356. implementation may place restrictions on the allowable alignments.
  357.  
  358.  
  359. A component clause specifies the storage place of a component, relative  to
  360. the start of the record.  The integer defined by the static expression of a
  361. component  clause  is  a  relative address expressed in storage units.  The
  362. range defines the bit positions of  the  storage  place,  relative  to  the
  363. storage  unit.   The  first storage unit of a record is numbered zero.  The
  364. first bit of a storage unit is numbered zero.  The ordering of  bits  in  a
  365. storage unit is machine-dependent and may extend to adjacent storage units.
  366. (For a specific machine, the size in bits of a storage unit is given by the
  367. configuration-dependent   named  number  SYSTEM.STORAGE_UNIT.)   Whether  a
  368. component is allowed to overlap a storage boundary,  and  if  so,  how,  is
  369. implementation-defined.
  370.  
  371.  
  372. At  most  one  component clause is allowed for each component of the record
  373. type, including for each discriminant (component clauses may be  given  for
  374. some, all, or none of the components).  If no component clause is given for
  375. a component, then the choice of the storage place for the component is left
  376. to  the  compiler.   If component clauses are given for all components, the
  377. record representation clause completely specifies the representation of the
  378. record type and must be obeyed exactly by the compiler.
  379.  
  380.  
  381. Storage places within a record variant must not overlap, but overlap of the
  382. storage for distinct variants is allowed.  Each component clause must allow
  383. for enough storage space  to  accommodate  every  allowable  value  of  the
  384. component.   A  component  clause  is  only  allowed for a component if any
  385. constraint on this component or on any of its subcomponents is static.
  386.  
  387.  
  388. An implementation may generate names that  denote  implementation-dependent
  389. components  (for  example, one containing the offset of another component).
  390. Such implementation-dependent names can be used  in  record  representation
  391. clauses  (these names need not be simple names;  for example, they could be
  392. implementation-dependent attributes).
  393.  
  394.  
  395. Example:
  396.  
  397.     WORD : constant := 4;  --  storage unit is byte, 4 bytes per word
  398.  
  399.     type STATE      is (A, M, W, P);
  400.     type MODE       is (FIX, DEC, EXP, SIGNIF);
  401.  
  402.     type BYTE_MASK  is array (0 .. 7) of BOOLEAN;
  403.     type STATE_MASK is array (STATE)  of BOOLEAN;
  404.     type MODE_MASK  is array (MODE)   of BOOLEAN;
  405.  
  406.     type PROGRAM_STATUS_WORD is
  407.        record
  408.           SYSTEM_MASK     : BYTE_MASK;
  409.           PROTECTION_KEY  : INTEGER range 0 .. 3;
  410.           MACHINE_STATE   : STATE_MASK;
  411.           INTERRUPT_CAUSE : INTERRUPTION_CODE;
  412.           ILC             : INTEGER range 0 .. 3;
  413.           CC              : INTEGER range 0 .. 3;
  414.           PROGRAM_MASK    : MODE_MASK;
  415.           INST_ADDRESS    : ADDRESS;
  416.        end record;
  417.  
  418.     for PROGRAM_STATUS_WORD use
  419.        record at mod 8;
  420.           SYSTEM_MASK     at 0*WORD range 0  .. 7;
  421.           PROTECTION_KEY  at 0*WORD range 10 .. 11;  --  bits 8, 9 unused
  422.           MACHINE_STATE   at 0*WORD range 12 .. 15;
  423.           INTERRUPT_CAUSE at 0*WORD range 16 .. 31;
  424.           ILC             at 1*WORD range 0  .. 1;   --  second word
  425.           CC              at 1*WORD range 2  .. 3;
  426.           PROGRAM_MASK    at 1*WORD range 4  .. 7;
  427.           INST_ADDRESS    at 1*WORD range 8  .. 31;
  428.        end record;
  429.  
  430.     for PROGRAM_STATUS_WORD'SIZE use 8*SYSTEM.STORAGE_UNIT;
  431.  
  432. Note on the example:
  433.  
  434.  
  435. The record representation clause defines the  record  layout.   The  length
  436. clause guarantees that exactly eight storage units are used.
  437.  
  438.  
  439. References:   allow  1.6,  attribute 4.1.4, constant 3.2.1, constraint 3.3,
  440. discriminant 3.7.1, integer type 3.5.4, must 1.6, named number  3.2,  range
  441. 3.5,  record  component 3.7, record type 3.7, simple expression 4.4, simple
  442. name 4.1, static constraint 4.9, static expression 4.9, storage unit  13.7,
  443. subcomponent 3.3, system package 13.7, variant 3.7.3
  444.  
  445. 13.5  Address Clauses
  446.  
  447.  
  448. An address clause specifies a required address in storage for an entity.
  449.  
  450.  
  451.     address_clause ::= for simple_name use at simple_expression;
  452.  
  453.  
  454. The expression given after the reserved word at must be of the type ADDRESS
  455. defined  in the package SYSTEM (see 13.7);  this package must be named by a
  456. with clause that applies to the  compilation  unit  in  which  the  address
  457. clause  occurs.   The conventions that define the interpretation of a value
  458. of the type ADDRESS as an address, as an interrupt level,  or  whatever  it
  459. may  be,  are  implementation-dependent.   The allowed nature of the simple
  460. name and the meaning of the corresponding address are as follows:
  461.  
  462.  
  463. (a)  Name of an object:  the  address  is  that  required  for  the  object
  464.      (variable or constant).
  465.  
  466.  
  467. (b)  Name of a subprogram, package, or task  unit:   the  address  is  that
  468.      required  for the machine code associated with the body of the program
  469.      unit.
  470.  
  471.  
  472. (c)  Name of a single entry:  the address specifies a hardware interrupt to
  473.      which the single entry is to be linked.
  474.  
  475.  
  476. If the simple name is  that  of  a  single  task,  the  address  clause  is
  477. understood  to  refer  to the task unit and not to the task object.  In all
  478. cases, the address clause is only legal if  exactly  one  declaration  with
  479. this  identifier  occurs  earlier,  immediately within the same declarative
  480. part, package specification, or task specification.  A name declared  by  a
  481. renaming declaration is not allowed as the simple name.
  482.  
  483.  
  484. Address  clauses  should  not  be  used  to  achieve overlays of objects or
  485. overlays of program units.  Nor should a given interrupt be linked to  more
  486. than  one entry.  Any program using address clauses to achieve such effects
  487. is erroneous.
  488.  
  489.  
  490. Example:
  491.  
  492.     for CONTROL use at 16#0020#;  --  assuming that SYSTEM.ADDRESS is an integer type
  493.  
  494. Notes:
  495.  
  496.  
  497. The above rules imply that if two subprograms overload each other  and  are
  498. visible at a given point, an address clause for any of them is not legal at
  499. this  point.   Similarly  if  a  task  specification  declares entries that
  500. overload each other, they cannot be interrupt entries.  The syntax does not
  501. allow an address clause for a library unit.  An implementation may  provide
  502. pragmas for the specification of program overlays.
  503.  
  504.  
  505. References:   address  predefined type 13.7, apply 10.1.1, compilation unit
  506. 10.1, constant 3.2.1, entity 3.1, entry 9.5, erroneous 1.6, expression 4.4,
  507. library unit 10.1, name 4.1, object 3.2, package  7,  pragma  2.8,  program
  508. unit  6,  reserved  word  2.9,  simple  expression  4.4,  simple  name 4.1,
  509. subprogram 6, subprogram body 6.3, system package 13.7, task body 9.1, task
  510. object 9.2, task unit 9, type 3.3, variable 3.2.1, with clause 10.1.1
  511.  
  512. 13.5.1  Interrupts
  513.  
  514.  
  515. An address clause given for an entry associates the entry with some  device
  516. that  may cause an interrupt;  such an entry is referred to in this section
  517. as an  interrupt  entry.   If  control  information  is  supplied  upon  an
  518. interrupt,  it  is  passed  to an associated interrupt entry as one or more
  519. parameters of mode in;  only parameters of this mode are allowed.
  520.  
  521.  
  522. An interrupt acts as an entry call issued by a hardware task whose priority
  523. is higher than the priority of the main program, and also higher  than  the
  524. priority of any user-defined task (that is, any task whose type is declared
  525. by  a  task  unit in the program).  The entry call may be an ordinary entry
  526. call, a timed entry call, or a conditional entry  call,  depending  on  the
  527. kind of interrupt and on the implementation.
  528.  
  529.  
  530. If  a  select statement contains both a terminate alternative and an accept
  531. alternative for an interrupt  entry,  then  an  implementation  may  impose
  532. further  requirements  for  the  selection  of the terminate alternative in
  533. addition to those given in section 9.4.
  534.  
  535.  
  536. Example:
  537.  
  538.     task INTERRUPT_HANDLER is
  539.        entry DONE;
  540.        for DONE use at 16#40#;  --  assuming that SYSTEM.ADDRESS is an integer type
  541.     end INTERRUPT_HANDLER;
  542.  
  543. Notes:
  544.  
  545.  
  546. Interrupt entry calls need only have the semantics described  above;   they
  547. may  be implemented by having the hardware directly execute the appropriate
  548. accept statements.
  549.  
  550.  
  551. Queued interrupts correspond to ordinary entry calls.  Interrupts that  are
  552. lost  if  not  immediately processed correspond to conditional entry calls.
  553. It is a consequence of the priority rules that an accept statement executed
  554. in response to an interrupt takes precedence  over  ordinary,  user-defined
  555. tasks, and can be executed without first invoking a scheduling action.
  556.  
  557.  
  558. One  of the possible effects of an address clause for an interrupt entry is
  559. to specify the priority of the interrupt (directly or indirectly).   Direct
  560. calls to an interrupt entry are allowed.
  561.  
  562.  
  563. References:   accept  alternative  9.7.1,  accept  statement  9.5,  address
  564. predefined type 13.7, allow 1.6, conditional entry call 9.7.2,  entry  9.5,
  565. entry call 9.5, mode 6.1, parameter of a subprogram 6.2, priority of a task
  566. 9.8,  select  alternative 9.7.1, select statement 9.7, system package 13.7,
  567. task 9, terminate alternative 9.7.1, timed entry call 9.7.3
  568.  
  569. 13.6  Change of Representation
  570.  
  571.  
  572. At most one representation clause is allowed for a given type and  a  given
  573. aspect  of  its representation.  Hence, if an alternative representation is
  574. needed, it is necessary to declare a second type, derived from  the  first,
  575. and to specify a different representation for the second type.
  576.  
  577.  
  578. Example:
  579.  
  580.     --  PACKED_DESCRIPTOR and DESCRIPTOR are two different types
  581.     --  with identical characteristics, apart from their representation
  582.  
  583.     type DESCRIPTOR is
  584.        record
  585.           --  components of a descriptor
  586.        end record;
  587.  
  588.     type PACKED_DESCRIPTOR is new DESCRIPTOR;
  589.  
  590.     for PACKED_DESCRIPTOR use
  591.        record
  592.           --  component clauses for some or for all components
  593.        end record;
  594.  
  595.  
  596. Change  of  representation  can  now  be  accomplished  by  assignment with
  597. explicit type conversions:
  598.  
  599.     D : DESCRIPTOR;
  600.     P : PACKED_DESCRIPTOR;
  601.  
  602.     P := PACKED_DESCRIPTOR(D);  --  pack D
  603.     D := DESCRIPTOR(P);         --  unpack P
  604.  
  605.  
  606. References:  assignment 5.2, derived type 3.4, type  3.3,  type  conversion
  607. 4.6, type declaration 3.1, representation clause 13.1
  608.  
  609. 13.7  The Package System
  610.  
  611.  
  612. For each implementation there is a predefined library package called SYSTEM
  613. which   includes   the   definitions   of  certain  configuration-dependent
  614. characteristics.    The   specification   of   the   package   SYSTEM    is
  615. implementation-dependent and must be given in Appendix F.  The visible part
  616. of this package must contain at least the following declarations.
  617.  
  618.  
  619.     package SYSTEM is
  620.        type ADDRESS is implementation_defined;
  621.        type NAME    is implementation_defined_enumeration_type;
  622.  
  623.        SYSTEM_NAME  : constant NAME := implementation_defined;
  624.  
  625.        STORAGE_UNIT : constant := implementation_defined;
  626.        MEMORY_SIZE  : constant := implementation_defined;
  627.  
  628.        --  System-Dependent Named Numbers:
  629.  
  630.        MIN_INT      : constant := implementation_defined;
  631.        MAX_INT      : constant := implementation_defined;
  632.        MAX_DIGITS   : constant := implementation_defined;
  633.        MAX_MANTISSA : constant := implementation_defined;
  634.        FINE_DELTA   : constant := implementation_defined;
  635.        TICK         : constant := implementation_defined;
  636.  
  637.        --  Other System-Dependent Declarations
  638.  
  639.        subtype PRIORITY is INTEGER range implementation_defined;
  640.  
  641.        ...
  642.     end SYSTEM;
  643.  
  644.  
  645. The  type ADDRESS is the type of the addresses provided in address clauses;
  646. it is also the type of the  result  delivered  by  the  attribute  ADDRESS.
  647. Values  of  the  enumeration type NAME are the names of alternative machine
  648. configurations handled by the implementation;  one of these is the constant
  649. SYSTEM_NAME.  The named number STORAGE_UNIT  is  the  number  of  bits  per
  650. storage  unit;   the  named  number  MEMORY_SIZE is the number of available
  651. storage units in the configuration;  these named numbers are  of  the  type
  652. universal_integer.
  653.  
  654.  
  655. An  alternative  form  of  the package SYSTEM, with given values for any of
  656. SYSTEM_NAME, STORAGE_UNIT, and MEMORY_SIZE, can be obtained by means of the
  657. corresponding pragmas.  These pragmas are only allowed at the  start  of  a
  658. compilation, before the first compilation unit (if any) of the compilation.
  659.  
  660.  
  661.     pragma SYSTEM_NAME(enumeration_literal);
  662.  
  663.  
  664. The  effect  of the above pragma is to use the enumeration literal with the
  665. specified identifier for the definition of the constant SYSTEM_NAME.   This
  666. pragma  is  only  allowed if the specified identifier corresponds to one of
  667. the literals of the type NAME.
  668.  
  669.  
  670.     pragma STORAGE_UNIT(numeric_literal);
  671.  
  672.  
  673. The effect of the above pragma is to use the value of the specified numeric
  674. literal for the definition of the named number STORAGE_UNIT.
  675.  
  676.  
  677.     pragma MEMORY_SIZE(numeric_literal);
  678.  
  679.  
  680. The effect of the above pragma is to use the value of the specified numeric
  681. literal for the definition of the named number MEMORY_SIZE.
  682.  
  683.  
  684. The compilation of any of these pragmas causes an implicit recompilation of
  685. the package SYSTEM.  Consequently any compilation unit that names SYSTEM in
  686. its context clause becomes obsolete after this implicit recompilation.   An
  687. implementation  may impose further limitations on the use of these pragmas.
  688. For example, an implementation may allow them only  at  the  start  of  the
  689. first compilation, when creating a new program library.
  690.  
  691. Note:
  692.  
  693.  
  694. It is a consequence of the visibility rules that a declaration given in the
  695. package  SYSTEM is not visible in a compilation unit unless this package is
  696. mentioned by a with clause that applies (directly  or  indirectly)  to  the
  697. compilation unit.
  698.  
  699.  
  700. References:    address   clause   13.5,   apply  10.1.1,  attribute  4.1.4,
  701. compilation  unit  10.1,  declaration  3.1,  enumeration   literal   3.5.1,
  702. enumeration  type 3.5.1, identifier 2.3, library unit 10.1, must 1.6, named
  703. number 3.2, number declaration  3.2.2,  numeric  literal  2.4,  package  7,
  704. package  specification  7.1,  pragma  2.8,  program library 10.1, type 3.3,
  705. visibility 8.3, visible part 7.2, with clause 10.1.1
  706.  
  707. 13.7.1  System-Dependent Named Numbers
  708.  
  709.  
  710. Within the package SYSTEM, the following named numbers are  declared.   The
  711. numbers FINE_DELTA and TICK are of the type universal_real;  the others are
  712. of the type universal_integer.
  713.  
  714.  
  715. MIN_INT       The smallest (most negative) value of all predefined  integer
  716.               types.
  717.  
  718.  
  719. MAX_INT       The largest (most positive) value of all  predefined  integer
  720.               types.
  721.  
  722.  
  723. MAX_DIGITS    The largest value  allowed  for  the  number  of  significant
  724.               decimal digits in a floating point constraint.
  725.  
  726.  
  727. MAX_MANTISSA  The largest possible number of binary digits in the  mantissa
  728.               of model numbers of a fixed point subtype.
  729.  
  730.  
  731. FINE_DELTA    The smallest delta allowed in a fixed point  constraint  that
  732.               has the range constraint -1.0 .. 1.0.
  733.  
  734.  
  735. TICK          The basic clock period, in seconds.
  736.  
  737.  
  738. References:   allow  1.6,  delta  of  a fixed point constraint 3.5.9, fixed
  739. point constraint 3.5.9,  floating  point  constraint  3.5.7,  integer  type
  740. 3.5.4,  model  number  3.5.6, named number 3.2, package 7, range constraint
  741. 3.5,  system  package  13.7,  type  3.3,  universal_integer   type   3.5.4,
  742. universal_real type 3.5.6
  743.  
  744. 13.7.2  Representation Attributes
  745.  
  746.  
  747. The  values  of  certain  implementation-dependent  characteristics  can be
  748. obtained by interrogating  appropriate  representation  attributes.   These
  749. attributes are described below.
  750.  
  751.  
  752. For any object, program unit, label, or entry X:
  753.  
  754.  
  755. X'ADDRESS       Yields the address  of  the  first  of  the  storage  units
  756.                 allocated  to  X.   For a subprogram, package, task unit or
  757.                 label, this value refers to  the  machine  code  associated
  758.                 with the corresponding body or statement.  For an entry for
  759.                 which an address clause has been given, the value refers to
  760.                 the  corresponding  hardware  interrupt.  The value of this
  761.                 attribute is of the type ADDRESS  defined  in  the  package
  762.                 SYSTEM.
  763.  
  764.  
  765. For any type or subtype X, or for any object X:
  766.  
  767.  
  768. X'SIZE          Applied to an object, yields the number of  bits  allocated
  769.                 to  hold  the object.  Applied to a type or subtype, yields
  770.                 the  minimum  number  of  bits  that  is  needed   by   the
  771.                 implementation  to hold any possible object of this type or
  772.                 subtype.  The value  of  this  attribute  is  of  the  type
  773.                 universal_integer.
  774.  
  775.  
  776. For the above two representation attributes, if the prefix is the name of a
  777. function,  the  attribute  is understood to be an attribute of the function
  778. (not of the result of calling the function).  Similarly, if the type of the
  779. prefix is an access type, the attribute is understood to be an attribute of
  780. the prefix (not of the designated object:  attributes of the latter can  be
  781. written with a prefix ending with the reserved word all).
  782.  
  783.  
  784. For any component C of a record object R:
  785.  
  786.  
  787. R.C'POSITION    Yields the offset, from the start of the first storage unit
  788.                 occupied  by  the record, of the first of the storage units
  789.                 occupied by C.  This offset is measured in  storage  units.
  790.                 The    value   of   this   attribute   is   of   the   type
  791.                 universal_integer.
  792.  
  793.  
  794. R.C'FIRST_BIT   Yields the offset, from the  start  of  the  first  of  the
  795.                 storage  units  occupied by C, of the first bit occupied by
  796.                 C.  This offset is measured in bits.   The  value  of  this
  797.                 attribute is of the type universal_integer.
  798.  
  799.  
  800. R.C'LAST_BIT    Yields the offset, from the  start  of  the  first  of  the
  801.                 storage units occupied by C, of the last bit occupied by C.
  802.                 This  offset  is  measured  in  bits.   The  value  of this
  803.                 attribute is of the type universal_integer.
  804.  
  805.  
  806. For any access type or subtype T:
  807.  
  808.  
  809. T'STORAGE_SIZE  Yields the total number of storage units reserved  for  the
  810.                 collection  associated  with the base type of T.  The value
  811.                 of this attribute is of the type universal_integer.
  812.  
  813.  
  814. For any task type or task object T:
  815.  
  816.  
  817. T'STORAGE_SIZE  Yields the  number  of  storage  units  reserved  for  each
  818.                 activation of a task of the type T or for the activation of
  819.                 the  task  object T.  The value of this attribute is of the
  820.                 type universal_integer.
  821.  
  822. Notes:
  823.  
  824.  
  825. For a task object X, the attribute X'SIZE gives the number of bits used  to
  826. hold the object X, whereas X'STORAGE_SIZE gives the number of storage units
  827. allocated  for  the  activation  of the task designated by X.  For a formal
  828. parameter X, if parameter passing is achieved by copy, then  the  attribute
  829. X'ADDRESS yields the address of the local copy;  if parameter passing is by
  830. reference, then the address is that of the actual parameter.
  831.  
  832.  
  833. References:   access  subtype  3.8, access type 3.8, activation 9.3, actual
  834. parameter 6.2, address clause 13.5, address predefined type 13.7, attribute
  835. 4.1.4, base type 3.3, collection 3.8,  component  3.3,  entry  9.5,  formal
  836. parameter  6.1  6.2,  label  5.1,  object 3.2, package 7, package body 7.1,
  837. parameter passing 6.2, program unit 6,  record  object  3.7,  statement  5,
  838. storage  unit  13.7, subprogram 6, subprogram body 6.3, subtype 3.3, system
  839. predefined package 13.7, task 9, task body 9.1, task object 9.2, task  type
  840. 9.2, task unit 9, type 3.3, universal_integer type 3.5.4
  841.  
  842. 13.7.3  Representation Attributes of Real Types
  843.  
  844.  
  845. For   every  real  type  or  subtype  T,  the  following  machine-dependent
  846. attributes are defined,  which  are  not  related  to  the  model  numbers.
  847. Programs  using  these  attributes  may  thereby exploit properties that go
  848. beyond the minimal properties associated with the numeric type (see section
  849. 4.5.7  for  the  rules  defining  the  accuracy  of  operations  with  real
  850. operands).    Precautions   must   therefore  be  taken  when  using  these
  851. machine-dependent attributes if portability is to be ensured.
  852.  
  853.  
  854. For both floating point and fixed point types:
  855.  
  856.  
  857. T'MACHINE_ROUNDS       Yields the value TRUE if every predefined arithmetic
  858.                        operation on values of the base  type  of  T  either
  859.                        returns   an  exact  result  or  performs  rounding;
  860.                        yields the value FALSE otherwise.  The value of this
  861.                        attribute is of the predefined type BOOLEAN.
  862.  
  863.  
  864. T'MACHINE_OVERFLOWS    Yields the value TRUE if every predefined  operation
  865.                        on  values  of  the base type of T either provides a
  866.                        correct   result,   or    raises    the    exception
  867.                        NUMERIC_ERROR  in  overflow  situations (see 4.5.7);
  868.                        yields the value FALSE otherwise.  The value of this
  869.                        attribute is of the predefined type BOOLEAN.
  870.  
  871.  
  872. For floating point types, the following attributes provide  characteristics
  873. of  the  underlying  machine representation, in terms of the canonical form
  874. defined in section 3.5.7:
  875.  
  876.  
  877. T'MACHINE_RADIX        Yields the value of the radix used  by  the  machine
  878.                        representation  of the base type of T.  The value of
  879.                        this attribute is of the type universal_integer.
  880.  
  881.  
  882. T'MACHINE_MANTISSA     Yields the number of digits in the mantissa for  the
  883.                        machine  representation  of  the base type of T (the
  884.                        digits  are  extended  digits  in  the  range  0  to
  885.                        T'MACHINE_RADIX -1).  The value of this attribute is
  886.                        of the type universal_integer.
  887.  
  888.  
  889. T'MACHINE_EMAX         Yields the largest value of exponent for the machine
  890.                        representation  of the base type of T.  The value of
  891.                        this attribute is of the type universal_integer.
  892.  
  893.  
  894. T'MACHINE_EMIN         Yields  the  smallest  (most  negative)   value   of
  895.                        exponent  for the machine representation of the base
  896.                        type of T.  The value of this attribute  is  of  the
  897.                        type universal_integer.
  898.  
  899. Note:
  900.  
  901.  
  902. For  many  machines  the  largest machine representable number of type F is
  903. almost
  904.  
  905.     (F'MACHINE_RADIX)**(F'MACHINE_EMAX),
  906.  
  907.  
  908. and the smallest positive representable number is
  909.  
  910.     F'MACHINE_RADIX ** (F'MACHINE_EMIN - 1)
  911.  
  912.  
  913. References:  arithmetic operator  4.5,  attribute  4.1.4,  base  type  3.3,
  914. boolean  predefined type 3.5.3, false boolean value 3.5.3, fixed point type
  915. 3.5.9, floating point type 3.5.7, model number  3.5.6,  numeric  type  3.5,
  916. numeric_error exception 11.1, predefined operation 3.3.3, radix 3.5.7, real
  917. type   3.5.6,   subtype   3.3,   true   boolean   value  3.5.3,  type  3.3,
  918. universal_integer type 3.5.4
  919.  
  920. 13.8  Machine Code Insertions
  921.  
  922.  
  923. A machine code insertion can be achieved by a call  to  a  procedure  whose
  924. sequence of statements contains code statements.
  925.  
  926.  
  927.     code_statement ::= type_mark'record_aggregate;
  928.  
  929.  
  930. A  code  statement  is  only  allowed  in  the  sequence of statements of a
  931. procedure body.  If a procedure body contains code statements, then  within
  932. this  procedure body the only allowed form of statement is a code statement
  933. (labeled or not), the only allowed declarative items are use  clauses,  and
  934. no  exception  handler  is  allowed  (comments  and  pragmas are allowed as
  935. usual).
  936.  
  937.  
  938. Each machine instruction appears as a record aggregate  of  a  record  type
  939. that defines the corresponding instruction.  The base type of the type mark
  940. of  a code statement must be declared within the predefined library package
  941. called MACHINE_CODE;  this package must be named  by  a  with  clause  that
  942. applies  to  the  compilation  unit in which the code statement occurs.  An
  943. implementation is not required to provide such a package.
  944.  
  945.  
  946. An implementation is allowed to impose further restrictions on  the  record
  947. aggregates  allowed  in  code statements.  For example, it may require that
  948. expressions contained in such aggregates be static expressions.
  949.  
  950.  
  951. An implementation may provide machine-dependent pragmas specifying register
  952. conventions and calling conventions.  Such pragmas must  be  documented  in
  953. Appendix F.
  954.  
  955.  
  956. Example:
  957.  
  958.     M : MASK;
  959.     procedure SET_MASK; pragma INLINE(SET_MASK);
  960.  
  961.     procedure SET_MASK is
  962.        use MACHINE_CODE;
  963.     begin
  964.        SI_FORMAT'(CODE => SSM, B => M'BASE_REG, D => M'DISP);
  965.        --  M'BASE_REG and M'DISP are implementation-specific predefined attributes
  966.     end;
  967.  
  968.  
  969. References:   allow  1.6, apply 10.1.1, comment 2.7, compilation unit 10.1,
  970. declarative item 3.9, exception handler 11.2, inline pragma 6.3.2,  labeled
  971. statement  5.1,  library unit 10.1, package 7, pragma 2.8, procedure 6 6.1,
  972. procedure body 6.3, record aggregate 4.3.1, record type  3.7,  sequence  of
  973. statements  5.1,  statement  5, static expression 4.9, use clause 8.4, with
  974. clause 10.1.1
  975.  
  976. 13.9  Interface to Other Languages
  977.  
  978.  
  979. A subprogram written in another language can be called from an Ada  program
  980. provided  that  all  communication  is achieved via parameters and function
  981. results.  A pragma of the form
  982.  
  983.  
  984.     pragma INTERFACE (language_name, subprogram_name);
  985.  
  986.  
  987. must be given for each such subprogram; a subprogram  name  is  allowed  to
  988. stand  for  several  overloaded subprograms.  This pragma is allowed at the
  989. place of a declarative item, and must apply in this case  to  a  subprogram
  990. declared  by  an  earlier  declarative item of the same declarative part or
  991. package specification.  The pragma is also allowed for a library unit;   in
  992. this  case  the  pragma  must appear  after the subprogram declaration, and
  993. before any subsequent compilation unit.  The  pragma  specifies  the  other
  994. language  (and  thereby  the  calling conventions) and informs the compiler
  995. that an object module will be supplied for the corresponding subprogram.  A
  996. body is not allowed for such a subprogram (not even in the form of  a  body
  997. stub)  since  the  instructions  of  the  subprogram are written in another
  998. language.
  999.  
  1000.  
  1001. This  capability  need  not  be  provided  by  all  implementations.     An
  1002. implementation  may place restrictions on the allowable forms and places of
  1003. parameters and calls.
  1004.  
  1005.  
  1006. Example:
  1007.  
  1008.     package FORT_LIB is
  1009.        function SQRT(X : FLOAT) return FLOAT;
  1010.        function EXP (X : FLOAT) return FLOAT;
  1011.     private
  1012.        pragma INTERFACE(FORTRAN, SQRT);
  1013.        pragma INTERFACE(FORTRAN, EXP);
  1014.     end FORT_LIB;
  1015.  
  1016. Notes:
  1017.  
  1018.  
  1019. The conventions used by other language processors that  call  Ada  programs
  1020. are  not  part  of  the  Ada language definition.  Such conventions must be
  1021. defined by these other language processors.
  1022.  
  1023.  
  1024. The pragma INTERFACE is not defined for generic subprograms.
  1025.  
  1026.  
  1027. References:  allow 1.6, body stub 10.2, compilation unit 10.1,  declaration
  1028. 3.1,  declarative  item  3.9,  declarative  part  3.9, function result 6.5,
  1029. library unit 10.1, must 1.6, name 4.1, overloaded subprogram  6.6,  package
  1030. specification 7.1, parameter of a subprogram 6.2, pragma 2.8, subprogram 6,
  1031. subprogram body 6.3, subprogram call 6.4, subprogram declaration 6.1
  1032.  
  1033. 13.10  Unchecked Programming
  1034.  
  1035.  
  1036. The  predefined  generic  library  subprograms  UNCHECKED_DEALLOCATION  and
  1037. UNCHECKED_CONVERSION are used for unchecked storage  deallocation  and  for
  1038. unchecked type conversions.
  1039.  
  1040.  
  1041.     generic
  1042.        type OBJECT is limited private;
  1043.        type NAME   is access OBJECT;
  1044.     procedure UNCHECKED_DEALLOCATION(X : in out NAME);
  1045.  
  1046.  
  1047.     generic
  1048.        type SOURCE is limited private;
  1049.        type TARGET is limited private;
  1050.     function UNCHECKED_CONVERSION(S : SOURCE) return TARGET;
  1051.  
  1052.  
  1053. References:  generic subprogram 12.1, library unit 10.1, type 3.3
  1054.  
  1055. 13.10.1  Unchecked Storage Deallocation
  1056.  
  1057.  
  1058. Unchecked  storage  deallocation  of  an object designated by a value of an
  1059. access type is achieved by a call  of  a  procedure  that  is  obtained  by
  1060. instantiation   of   the  generic  procedure  UNCHECKED_DEALLOCATION.   For
  1061. example:
  1062.  
  1063.     procedure FREE is new UNCHECKED_DEALLOCATION(object_type_name, access_type_name);
  1064.  
  1065.  
  1066. Such a FREE procedure has the following effect:
  1067.  
  1068.  
  1069. (a)  after executing FREE(X), the value of X is null;
  1070.  
  1071.  
  1072. (b)  FREE(X), when X is already equal to null, has no effect;
  1073.  
  1074.  
  1075. (c)  FREE(X), when X is not equal to null, is an indication that the object
  1076.      designated by X is  no  longer  required,  and  that  the  storage  it
  1077.      occupies is to be reclaimed.
  1078.  
  1079.  
  1080. If  X and Y designate the same object, then accessing this object through Y
  1081. is erroneous if this access is performed  (or  attempted)  after  the  call
  1082. FREE(X);  the effect of each such access is not defined by the language.
  1083.  
  1084. Notes:
  1085.  
  1086.  
  1087. It  is  a  consequence  of  the visibility rules that the generic procedure
  1088. UNCHECKED_DEALLOCATION is not visible in a  compilation  unit  unless  this
  1089. generic  procedure  is  mentioned  by  a  with  clause  that applies to the
  1090. compilation unit.
  1091.  
  1092.  
  1093. If X designates a task object, the call FREE(X) has no effect on  the  task
  1094. designated  by  the  value  of  this  task  object.  The same holds for any
  1095. subcomponent of the object designated by X, if this subcomponent is a  task
  1096. object.
  1097.  
  1098.  
  1099. References:    access  type  3.8,  apply  10.1.1,  compilation  unit  10.1,
  1100. designate 3.8 9.1,  erroneous  1.6,  generic  instantiation  12.3,  generic
  1101. procedure  12.1, generic unit 12, library unit 10.1, null access value 3.8,
  1102. object 3.2, procedure 6, procedure call 6.4, subcomponent 3.3, task 9, task
  1103. object 9.2, visibility 8.3, with clause 10.1.1
  1104.  
  1105. 13.10.2  Unchecked Type Conversions
  1106.  
  1107.  
  1108. An unchecked type conversion can be achieved by a call of a  function  that
  1109. is  obtained by instantiation of the generic function UNCHECKED_CONVERSION.
  1110.  
  1111.  
  1112. The effect of an unchecked conversion  is  to  return  the  (uninterpreted)
  1113. parameter  value  as  a  value of the target type, that is, the bit pattern
  1114. defining the source value is returned unchanged as the bit pattern defining
  1115. a value of the target type.  An implementation may  place  restrictions  on
  1116. unchecked   conversions,   for   example,  restrictions  depending  on  the
  1117. respective  sizes  of  objects  of  the  source  and  target  type.    Such
  1118. restrictions must be documented in appendix F.
  1119.  
  1120.  
  1121. Whenever   unchecked   conversions   are   used,  it  is  the  programmer's
  1122. responsibility to ensure that these  conversions  maintain  the  properties
  1123. that  are  guaranteed  by  the  language  for  objects  of the target type.
  1124. Programs that violate these properties by means  of  unchecked  conversions
  1125. are erroneous.
  1126.  
  1127. Note:
  1128.  
  1129.  
  1130. It  is  a  consequence  of  the  visibility rules that the generic function
  1131. UNCHECKED_CONVERSION is not visible  in  a  compilation  unit  unless  this
  1132. generic  function  is  mentioned  by  a  with  clause  that  applies to the
  1133. compilation unit.
  1134.  
  1135.  
  1136. References:  apply 10.1.1, compilation unit 10.1,  erroneous  1.6,  generic
  1137. function 12.1, instantiation 12.3, parameter of a subprogram 6.2, type 3.3,
  1138. with clause 10.1.1
  1139.