# Ada Programming/Attributes

subprograms are declared, certain properties thereof normally are left
to the compiler to specify (like the size or the address of a variable,
the calling convention of a subprogram). Properties which may be queried
are called *Attributes*; those which may be specified are called
Aspects. Aspects and attributes
are defined in the Ada Reference Manual annex
.

## Language summary attributes

The concept of **attributes** is pretty unique to
Ada. Attributes allow you to get ---and
sometimes set--- information about objects or other language entities
such as types. A good example is the
 attribute. It describes the size of
an object or a type in bits.

`A : Natural := Integer'``; `

However, unlike the  operator
from C/C++ the
 attribute can also be set:

` Byte `` `` -128 .. 127;  `\
`                                 `\
`  Byte'`` `` 8;            `

Of course not all attributes can be set. An attribute starts with a tick
\' and is followed by its name. The compiler determines by context if
the tick is the beginning of an attribute, a character literal or a
quantified expression.

`A : Character := Character'`` (32);     `\
`B : Character := ' ';                    `\
`S : String    := Character'(')')'Image;  `

## List of language defined attributes

Ada 2005 : This is a new Ada 2005 attribute.\
Ada 2012 : This is a new Ada 2012 attribute.\
Obsolescent : This is a deprecated attribute and should not be used in new code.

### A -- B

-   \'Access
-   \'Address
-   \'Adjacent
-   \'Aft
-   \'Alignment
-   \'Base
-   \'Bit_Order
-   \'Body_Version

### C

-   \'Callable
-   \'Caller
-   \'Ceiling
-   \'Class
-   \'Component_Size
-   \'Compose
-   \'Constrained
-   \'Copy_Sign
-   \'Count

### D -- F

-   \'Definite
-   \'Delta
-   \'Denorm
-   \'Digits
-   \'Emax
    `<small>`{=html}(Obsolescent)`</small>`{=html}
-   \'Exponent
-   \'External_Tag
-   \'Epsilon
    `<small>`{=html}(Obsolescent)`</small>`{=html}
-   \'First
-   \'First_Bit
-   \'Floor
-   \'Fore
-   \'Fraction

### G -- L

-   \'Has_Same_Storage
    `<small>`{=html}(Ada 2012)`</small>`{=html}
-   \'Identity
-   \'Image
-   \'Input
-   \'Large
    `<small>`{=html}(Obsolescent)`</small>`{=html}
-   \'Last
-   \'Last_Bit
-   \'Leading_Part
-   \'Length

### M

-   \'Machine
-   \'Machine_Emax
-   \'Machine_Emin
-   \'Machine_Mantissa
-   \'Machine_Overflows
-   \'Machine_Radix
-   \'Machine_Rounding
    `<small>`{=html}(Ada 2005)`</small>`{=html}
-   \'Machine_Rounds
-   \'Mantissa
    `<small>`{=html}(Obsolescent)`</small>`{=html}
-   \'Max
-   \'Max_Alignment_For_Allocation
    `<small>`{=html}(Ada 2012)`</small>`{=html}
-   \'Max_Size_In_Storage_Elements
-   \'Min
-   \'Mod
    `<small>`{=html}(Ada 2005)`</small>`{=html}
-   \'Model
-   \'Model_Emin
-   \'Model_Epsilon
-   \'Model_Mantissa
-   \'Model_Small
-   \'Modulus

### O -- R

-   \'Old
    `<small>`{=html}(Ada 2012)`</small>`{=html}
-   \'Output
-   \'Overlaps_Storage
    `<small>`{=html}(Ada 2012)`</small>`{=html}
-   \'Partition_ID
-   \'Pos
-   \'Position
-   \'Pred
-   \'Priority
    `<small>`{=html}(Ada 2005)`</small>`{=html}
-   \'Range
-   \'Read
-   \'Remainder
-   \'Result
    `<small>`{=html}(Ada 2012)`</small>`{=html}
-   \'Round
-   \'Rounding

### S

-   \'Safe_Emax
    `<small>`{=html}(Obsolescent)`</small>`{=html}
-   \'Safe_First
-   \'Safe_Large
    `<small>`{=html}(Obsolescent)`</small>`{=html}
-   \'Safe_Last
-   \'Safe_Small
    `<small>`{=html}(Obsolescent)`</small>`{=html}
-   \'Scale
-   \'Scaling
-   \'Signed_Zeros
-   \'Size
-   \'Small
-   \'Storage_Pool
-   \'Storage_Size
-   \'Stream_Size
    `<small>`{=html}(Ada 2005)`</small>`{=html}
-   \'Succ

### T -- V

-   \'Tag
-   \'Terminated
-   \'Truncation
-   \'Unbiased_Rounding
-   \'Unchecked_Access
-   \'Val
-   \'Valid
-   \'Value
-   \'Version

### W -- Z

-   \'Wide_Image
-   \'Wide_Value
-   \'Wide_Wide_Image
    `<small>`{=html}(Ada 2005)`</small>`{=html}
-   \'Wide_Wide_Value
    `<small>`{=html}(Ada 2005)`</small>`{=html}
-   \'Wide_Wide_Width
    `<small>`{=html}(Ada 2005)`</small>`{=html}
-   \'Wide_Width
-   \'Width
-   \'Write

## List of implementation defined attributes

The following attributes are not available in all Ada compilers, only in
those that had implemented them.

Currently, there are only listed the implementation-defined attributes
of a few compilers. You can help Wikibooks
adding
specific attributes of other compilers:

GNAT : Implementation-defined attribute of the GNAT compiler from AdaCore/FSF.\
HP Ada : Implementation-defined attribute of the HP Ada compiler (formerly known as \"DEC Ada\").\
ICC : Implementation-defined attribute[^1] of the Irvine ICC compiler.\
PowerAda : Implementation-defined attribute of OC Systems\' PowerAda.\
SPARCompiler : Implementation-defined attribute of Sun\'s SPARCompiler Ada.

### A -- D

-   \'Abort_Signal
    (GNAT)
-   \'Address_Size
    (GNAT)
-   \'Architecture
    (ICC)
-   \'Asm_Input
    (GNAT)
-   \'Asm_Output
    (GNAT)
-   \'AST_Entry
    (GNAT, HP Ada)
-   \'Bit (GNAT, HP Ada)
-   \'Bit_Position
    (GNAT)
-   \'CG_Mode (ICC)
-   \'Code_Address
    (GNAT)
-   \'Compiler_Key
    (SPARCompiler)
-   \'Compiler_Version
    (SPARCompiler)
-   \'Declared (ICC)
-   \'Default_Bit_Order
    (GNAT)
-   \'Dope_Address
    (SPARCompiler)
-   \'Dope_Size
    (SPARCompiler)

### E -- H

-   \'Elaborated
    (GNAT)
-   \'Elab_Body
    (GNAT)
-   \'Elab_Spec
    (GNAT)
-   \'Emax (GNAT)
-   \'Enabled (GNAT)
-   \'Entry_Number
    (SPARCompiler)
-   \'Enum_Rep (GNAT)
-   \'Enum_Val (GNAT)
-   \'Epsilon (GNAT)
-   \'Exception_Address
    (ICC)
-   \'Extended_Aft
    (PowerAda)
-   \'Extended_Base
    (PowerAda)
-   \'Extended_Digits
    (PowerAda)
-   \'Extended_Fore
    (PowerAda)
-   \'Extended_Image
    (PowerAda)
-   \'Extended_Value
    (PowerAda)
-   \'Extended_Width
    (PowerAda)
-   \'Extended_Wide_Image
    (PowerAda)
-   \'Extended_Wide_Value
    (PowerAda)
-   \'Extended_Wide_Width
    (PowerAda)
-   \'Fixed_Value
    (GNAT)
-   \'Has_Access_Values
    (GNAT)
-   \'Has_Discriminants
    (GNAT)
-   \'High_Word
    (ICC)
-   \'Homogeneous
    (SPARCompiler)

### I -- N

-   \'Img (GNAT)
-   \'Integer_Value
    (GNAT)
-   \'Invalid_Value
    (GNAT)
-   \'Linear_Address
    (ICC)
-   \'Low_Word (ICC)
-   \'Machine_Size
    (GNAT, HP Ada)
-   \'Max_Interrupt_Priority
    (GNAT)
-   \'Max_Priority
    (GNAT)
-   \'Maximum_Alignment
    (GNAT)
-   \'Mechanism_Code
    (GNAT)
-   \'Null_Parameter
    (GNAT, HP Ada)

### O -- T

-   \'Object_Size
    (GNAT)
-   \'Old (GNAT)
-   \'Passed_By_Reference
    (GNAT)
-   \'Pool_Address
    (GNAT)
-   \'Range_Length
    (GNAT)
-   \'Ref (SPARCompiler)
-   \'Storage_Unit
    (GNAT)
-   \'Stub_Type
    (GNAT)
-   \'Target (ICC)
-   \'Target_Name
    (GNAT)
-   \'Task_ID
    (SPARCompiler)
-   \'Tick (GNAT)
-   \'To_Address
    (GNAT)
-   \'Type_Class
    (GNAT, HP Ada)
-   \'Type_Key
    (SPARCompiler)

### U -- Z

-   \'UET_Address
    (GNAT)
-   \'Unconstrained_Array
    (GNAT)
-   \'Universal_Literal_String
    (GNAT)
-   \'Unrestricted_Access
    (GNAT, ICC)
-   \'VADS_Size
    (GNAT)
-   \'Value_Size
    (GNAT)
-   \'Wchar_T\_Size
    (GNAT)
-   \'Word_Size
    (GNAT)

## See also

### Wikibook

-   Ada Programming
-   Ada Programming/Aspects
-   Ada Programming/Pragmas
-   Ada Programming/Keywords

### Ada Reference Manual

#### Ada 83

-   
-   
#### Ada 95

-   
-   
#### Ada 2005

-   
-   
#### Ada 2012

-   
-   
## References

```{=html}
<references/>
```
Programming}}\|Attributes es:Programación
en Ada/Atributos

[^1]: \"4.2 ICC-Defined Attributes\", *ICC Ada Implementation Reference
    --- ICC Ada Version 8.2.5 for i960MC Targets*, document version
    2.11.4 1
