comp.lang.ada
 help / color / mirror / Atom feed
* Record Aggregate Bug
@ 1996-06-21  0:00 Robert Dewar
  0 siblings, 0 replies; only message in thread
From: Robert Dewar @ 1996-06-21  0:00 UTC (permalink / raw)



In article <mcriley.835361851@BIX.com>, mcriley on BIX <mcriley@BIX.com> wrote:
   type Task_Record_Type is
       record
           Originator : String (1 .. 20);
           Header_Dtg : String (1 .. 12);
       end record;

    Task_Record : Task_Record_Type := (others => (others => ' '));"

This is perfectly fine (T.E.D. worried about the subtypes being different,
but the relevant RM quote talks about same types, not same subtypes).
These declarations compile and execute fine on GNAT.

I don't however like this coding style very much, it is definitely
obscure, I think others is better avoided in record aggregates, and
would far prefer to see

    Task_Record := Task_Record_Type := (Originator => (others => ' '),
                                        Header_Dtg => (others => ' '));

Much clearer (and presumably as a bonus will work past the bug on the
other unnamed compiler :-)





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-06-21  0:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-06-21  0:00 Record Aggregate Bug Robert Dewar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox