Ada 95 Quality and Style Guide Chapter 7

Chapter 7: Portability - TOC - 7.1 FUNDAMENTALS

7.1.1 Obsolescent Features


  • In programs or components intended to have a long life, avoid using the features of Ada declared as "obsolescent" by Annex J of the Ada Reference Manual (1995), unless the use of the feature is needed for backward compatibility with Ada 83 (Ada Reference Manual 1983).
  • Document the use of any obsolescent features.
  • Avoid using the following features:

    - The short renamings of the packages in the predefined environment (e.g., Text_IO as opposed to Ada.Text_IO)
    - The character replacements of ! for |, : for #, and % for quotation marks
    - Reduced accuracy subtypes of floating-point types
    - The 'Constrained attribute as applied to private types
    - The predefined package ASCII
    - The exception Numeric_Error
    - Various representation specifications, including at clauses, mod clauses, interrupt entries, and the Storage_Size attribute

  • rationale

    Ten years of reflection on the use of Ada 83 led to the conclusion that some features of the original language are not as useful as originally intended. These features have been replaced with others in the Ada 95 revision. It would have been desirable to remove the obsolescent features completely, but that would have prevented the upward compatible transition of programs from Ada 83 to Ada 95. Thus, the obsolescent features remain in the language and are explicitly labeled as such in Annex J of the Ada Reference Manual (1995). The features listed in Annex J are candidates for removal from the language during its next revision. If a program's lifetime may extend beyond the next language revision, it should avoid the obsolescent language features unless backward compatibility with Ada 83 forces their use.


    When you instantiate Ada.Text_IO.Float_IO, the values of the Default_Fore and Default_Aft fields are set from the values of the 'Fore and 'Aft attributes of the actual floating-point type used in the instantiation. If you declare a reduced accuracy floating-point type that you then use to instantiate Ada.Text_IO.Float_IO, the output field widths are determined from the reduced accuracy type, although the implementation accuracy is unchanged (Rationale 1995, 3.3).

    < Previous Page Search Contents Index Next Page >
    1 2 3 4 5 6 7 8 9 10 11
    Appendix References Bibliography