From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,26a8192d4bd74b0f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-03-29 08:54:03 PST Path: nntp.gmd.de!Germany.EU.net!howland.reston.ans.net!cs.utexas.edu!news.ti.com!news.dseg.ti.com!news.dseg.ti.com!bpriest From: bpriest@ti.com (Bill Priest) Newsgroups: comp.lang.ada Subject: Size Rep clauses on Ada83 vs. Ada95 Date: 28 Mar 1995 17:08:12 GMT Organization: Texas Instruments, Inc. Distribution: world Message-ID: NNTP-Posting-Host: adr14.dseg.ti.com Date: 1995-03-28T17:08:12+00:00 List-Id: Per 13.2 of Ada Programming Language Reference Manual (MIL-STD-1815a-1983) " Size specification: T'SIZE The expression must be a static expression of some integer type. The value of the expression specifies an upper bound for the number of bits to be allocated to objects of the type or first named subtype T. The size specification must allow for enough storage space to accommodate every allowable value of these objects. A size specification for a composite type may affect the size of the gaps between the storage areas allocated to consecutive components. On the other hand, it need not affect the size of the storage area allocated to each component. The size specification is only allowed if the constraints on T and on its subcomponents (if any) are static. In the case of an unconstrained array type, the index subtypes must also be static." Any typos in the above are mine. Code I have written for the Tartan Ada C3x compiler is behaving incorrectly; a simple example illustrating the problem follows: with text_io; procedure test is type x_type is new boolean; for x_type'size use 32; type y_record_type is record one : x_type; two : x_type; end record; type position_array_type is array (0 .. 1) of natural; y : y_record_type; z : position_array_type; begin z(0) := y.one'position; z(1) := y.two'position; if (z (0) = z (1)) then text_io.put_line ("Positions were equal."); else text_io.put_line ("Positions were not equal."); end if; end test; The output of running this program is "Positions were equal." Is this a illegal program or a compiler bug. Thanks in advance, Bill