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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5ccd8ee851fe2e00,start X-Google-Attributes: gid103376,public From: mcriley@BIX.com (mcriley on BIX) Subject: Record aggregate question (language lawyer needed!) Date: 1996/06/21 Message-ID: #1/1 X-Deja-AN: 161378416 organization: Delphi Internet Services Corporation keywords: record aggregate bug newsgroups: comp.lang.ada summary: Is this record aggregate legal? Date: 1996-06-21T00:00:00+00:00 List-Id: The following test program is accepted without question by one Ada compiler and executes without any qualms, while another warns of a constraint_error at runtime. Which is correct, or, is the exact implementation left up to the compiler implementor? procedure Rec_Test is type Task_Record_Type is record Originator : String (1 .. 20); Header_Dtg : String (1 .. 12); end record; Task_Record : Task_Record_Type := (others => (others => ' ')); begin null; end rec_test; The relevant part of the LRM is 4.3.1[1]: "A component association with the choice others [...] is only allowed if the represented components are all of the same type." Well the components are both of the same _type_, but obviously the subtype constraints vary. The nature of the warning produced by the one compiler reflects that: "Subtype_Match_Error". Any input on this would be most appreciated. Marc A. Criley