Ada 95 Quality and Style Guide Chapter 7

Chapter 7: Portability - TOC - 7.6 REPRESENTATION CLAUSES AND IMPLEMENTATION-DEPENDENT FEATURES

7.6.2 Package System

guideline

  • Avoid using package System constants except in attempting to generalize other machine-dependent constructs.

  • rationale

    Because the values in this package are implementation-provided, unexpected effects can result from their use.

    notes

    If you must guarantee that physical record layouts will remain the same between implementations, you can express record fields by their first and last bit positions as shown in the Ada Reference Manual (1995, §13.5.1). Static expressions and named numbers should be used to let the compiler compute the endpoints of each range in terms of earlier fields. In this case, greater portability can be achieved by using System.Storage_Unit to let the compiler compute the value of the named number. However, this method might not work for all values of System.Storage_Unit.

    exceptions

    Do use package System constants to parameterize other implementation-dependent features (see Pappas (1985, §13.7.1).


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