DEVELOPMENT EDITION · 769442725406
Diagnostics Reference
On this page

B0904: obsolescent representation clause or constraint

Catalog status: active. Default severity: error. Stable name: obsolescent-clause. Family: Syntax and source text.

Three Ada 83 forms are obsolescent: address clauses written for X use at A; (J.7), at mod N in record representation clauses (J.8), and in subtype indications a digits constraint on a floating-point subtype or a delta constraint (J.3). Verada rejects them. An object's address is given in the modern form, the Address aspect or the clause for X'Address use A;, on a volatile object declared in a package. A digits constraint on a decimal fixed-point subtype is not obsolescent (RM 3.5.9), and Verada takes it.

Example (Vada)

for Pair use record
   at mod 4;
   A at 0 range 0 .. 31;
end record;

What to do

Use the Alignment aspect on the type (type Pair is record ... end record with Alignment => 4;), declare subtypes with range constraints, and give an object's address with for X'Address use A; or the Address aspect.

Regression source and further reading

Complete regression example: source, command arguments and expected results. The fixture deliberately reproduces this diagnostic.

See syntax and source text, the code index, and diagnostic interpretation for modes, replay, fix-its and JSON.