[Info-vax] OT: lightweight 90s viewer for Level 2 Postscript. Plus compiler-related obscureness.

ChrisQ meru at devnull.com
Thu Aug 23 18:54:18 EDT 2012


On 08/23/12 19:45, John Wallace wrote:

> Who speaks Ada round here? The following example illustrates the
> principle rather than the exact syntax (which, being Ada, is
> inevitably much more complex than I can remember, though I can happily
> read Ada and have been doing so for far too long).
>
> What's the difference between an Ada array whose elements are
> initialised using something like:
> array_instance : [const?] array_type := (scalar_a'address,
> scalar_b'address ...);
> and an array initialised using the notation
> array_instance : [const?] array_type := ( 1 =>  scalar_a'address, 2 =>
> scalar_b'address);
>
> The correct answer, apparently, is that they are intended to be
> equivalent, at least in the obvious case where every element in an
> array with an integer index is initialised (or something like that).
>
> However, two of us independently spotted at the same time today that
> the two notations when fed into the older compiler generate different
> initialisers. One notation correctly generates initialisers which at
> run time end up in the right place in ROM (if const) or RAM (if not
> const). The other notation just allocates space in RAM (in bss) with
> nothing to initialise it (not even something in ROM to copy to RAM to
> set it up). The one with " =>  " is the wrong'un in this picture.
>

Know very little about ada, but strange coincidence, after reading a
thread elsewhere, bought a couple of s/hand books to have a look at.
Both by Barnes, one describing the SPARK version, the other ada 95. I
know there is a later standard, but all those books are expensive,
whereas I just want to dip toe in water at this stage.

I wonder if your problem has anything to do with the difference in the
early and later standards and the compilers, compiler switches?...

> Deeep joy.

That'l be a keggy flade, then ? :-)...

Regards,

Chris



More information about the Info-vax mailing list