comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@gnat.com (Robert Dewar)
Subject: Re: Is this a GNAT bug???
Date: 29 Apr 2002 19:44:31 -0700
Date: 2002-04-30T02:44:32+00:00	[thread overview]
Message-ID: <5ee5b646.0204291844.21d7f5f0@posting.google.com> (raw)
In-Reply-To: db500a4f.0204290745.3cf7d2d@posting.google.com

robert_s_quinn@yahoo.com (Robert Quinn) wrote in message news:<db500a4f.0204290745.3cf7d2d@posting.google.com>...
> Mark Johnson <mark_h_johnson@raytheon.com> wrote in message news:<3CC992D6.A87A3443@raytheon.com>...

> Yes, the alignment is 1.  This doesn't make sense to me.  Why can I
> specify any size I want, up to size 64, but arrays over 64 bits have
> to have a size as a multiple of 8?  What is so special about 64 bits
> or less?

The language of rep clauses allows you to specify all sorts of things
that might not actually be allowed by a given compiler, e.g.

   type r is range 0 .. 1;
   for r'size use 999999999999999999999;

   for q'alignment use 43;

   for l'component'size use 83;

So the question is what set of rep clauses is implemented by a given compiler.
If you have an annex C compliant compiler, then there is a certainly well
defined subset which must be implemented. By staying within this subset you
achieve greater portability. Once you stray outside this subset, you are 
writing non-portable code that is implementation dependent. It does not
mean that your code is nonsense, just that it may not be implemented.

No two compilers have exactly the same set of allowed rep clauses. For instance
in comparing VADS and GNAT, there are clauses that VADS accepts that GNAT does
not (you identify one such in your message), and there are many clauses that
GNAT accepts that VADS does not (including all the new Ada 95 stuff :-)

Now if you are asking specifically in this case why GNAT does not implement
the non-portable rep clause you wish to use, the answer is that we can't
implement everything, so we implement what is most useful to our customers,
considered against the implementation cost.

If you were a customer of ACT, and willing to pay for this feature to be
added, no doubt ACT could be persuaded to accomodate you :-)

If your legacy code depends on particular rep clauses being supported, then
you had better pick a compiler that supports them. In fact GNAT supports almost
all the rep clauses supported by VADS precisely because we have many customers
who have converted legacy VADS code to GNAT. It just turns out that this 
particular case has not arisen in a significant manner.

Robert Dewar
Ada Core Technologies



  reply	other threads:[~2002-04-30  2:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-26 16:36 Is this a GNAT bug??? Robert Quinn
2002-04-26 17:48 ` Mark Johnson
2002-04-26 22:20   ` Robert Dewar
2002-04-29 15:45   ` Robert Quinn
2002-04-30  2:44     ` Robert Dewar [this message]
2002-04-30 14:15       ` Larry Kilgallen
2002-04-30 16:41       ` Robert Quinn
2002-04-30 18:20         ` tmoran
2002-05-01  1:31           ` Robert Quinn
2002-05-01 17:08             ` Ted Dennison
2002-05-02  1:55               ` Larry Kilgallen
2002-05-02 14:04                 ` Mark Johnson
2002-05-02 15:25                   ` Larry Kilgallen
2002-04-30 21:55         ` Mark Johnson
2002-05-01 22:59           ` Nick Roberts
2002-05-02 13:56             ` Mark Johnson
2002-05-02 20:19               ` Nick Roberts
2002-05-02 21:55                 ` Mark Johnson
  -- strict thread matches above, loose matches on Subject: below --
2003-09-20 22:50 Is this a gnat bug? Waldek Hebisch
2003-09-20 23:09 ` Ludovic Brenta
2003-09-21  2:37 ` Waldek Hebisch
replies disabled

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