[comp.lang.ada] Ada9X Special Report on Pragmas and Attributes

Kenneth.Fowler@SEI.CMU.EDU (08/15/89)

A Software Engineering Institute Special Report 
entitled-

     "Ada Compiler Pragmas and Attributes,
      An Implementation-Dependent Study"

has recently been completed for the Ada9X Project 
Office. This task is one of several being conducted 
as "complex study issues" in preparation for revision 
to the Ada language. Ada 9X Project team activities 
at the SEI are led by John Goodenough. John reports 
directly to Chris Anderson, Ada 9X Project Manager 
at Eglin AFB, Florida. A recitation of the task 
directive and study abstract follows:

                Task Description

"Implementation-dependent pragmas and attributes:
A variety of implementation-dependent pragmas and
attributes have been developed by different compiler
vendors. The SEI shall survey all such implementations
dependiecies, documented in Appendix F by each vendor,
to determine if some of the pragmas and attributes 
should be added to the Ada language standard in order
to improve uniformity among compilers. The product of
this task is an Implementation-Dependent Pragmas and
Attributes Study Report."

                   Abstract

The Ada Language Reference Manual describes an 
assortment of compiler pragmas and attributes which 
a validated compiler must support. A compiler may add 
other pragmas and attributes as long as the legality 
of the program cannot be influenced. This study examines 
most of the current offering of the latter group with 
the goal of identifying new candidates for language 
definition. Compiler support for language-defined 
pragmas is first characterized and we show that the 
level of support varies surprisingly between 
implementations. Based on trends in the data, 
we point to specific language rule inconsistencies 
and to a lack of requisite validation testing as the 
most probable cause. A change in the LRM is recommended 
to remedy the problem along with improved conformance 
checking. The growing body of implementation-defined 
pragmas is profiled and the largest class (26%) are 
shown to substitute for pragma INTERFACE. An increase 
in functionality for INTERFACE is suggested which meets 
the same user needs and improves overall uniformity 
between compilers. A variety of implementation-defined 
pragmas are offered to improve program performance. 
Some of these pragmas rely on the user to voluntarily 
give-up certain forms of Ada expression. When usage 
restrictions are abrogated in the presence of these 
pragmas undefined behavior may result. As a basic 
precaution, compilers should warn the user when risk 
conditions arise in this context. In contrast to pragmas, 
we found very few implementation-dependent attributes 
and none which provided a functionality significantly 
greater than that existing in the language. Attributes 
thus remain a largely unexplored realm for innovation.