comp.lang.ada
 help / color / mirror / Atom feed
From: byhoe@greenlime.com (Adrian Hoe)
Subject: Re: Size and pack
Date: 31 Oct 2001 17:58:05 -0800
Date: 2001-11-01T01:58:06+00:00	[thread overview]
Message-ID: <9ff447f2.0110311758.2be52637@posting.google.com> (raw)
In-Reply-To: nHRD7.162473$vq.40258001@typhoon.ne.mediaone.net

"Jeff Creem" <jeff@thecreems.com> wrote in message news:<nHRD7.162473$vq.40258001@typhoon.ne.mediaone.net>...
> OK.. I know I am going to regret this since whenever I question Robert I
> usually am wrong however
> without using the complete context of this thread, I believe Roberts
> statement is actually
> a little too broad. There ARE indeed times when you want a pragma pack and a
> rep spec. Not for the record case but for arrays of items that have been rep
> spec'ed.
> 
> for example, the code fragment
> 
> type My_Type is range 0 .. 3;
> for My_Type'size use 2;
> 
> type My_Array is array (1 .. 4) of My_Type;
> pragma Pack (My_Array); -- Without this the following could fail
> for My_Array'size use 8;
> 
> 
> The pragma pack is needed I believe because the rep spec on My_Array can
> be rejected without it (At least it has been rejected by some compilers and
> I forget
> the exact rule but it had something to do with the final rep spec not being
> allowed to
> change the layout of the items within the array).
> 
> Having said that VADS used to compile this without the pragma pack. Green
> Hills did not.
> I *THINK* GNAT does allow it to go through without the rep spec for several
> versions now.


But, why the differenct implementation by these compilers' vendors? I
thought Ada is a standardized language regardless of platforms. Of
course, a problem like whether to use "pragma pack" or not in the
above Jeff's example "supposed" not to arise if Ada is standardized.

Oh... I am getting quite confusing now, and not to mention Ada
newbies!



> 
> "Robert Dewar" <dewar@gnat.com> wrote in message
> news:5ee5b646.0110301750.38ba5bfd@posting.google.com...
> > john.mccabe@emrad.com.nospam (John McCabe) wrote in message
>  news:<3bc41989.4285341@news.demon.co.uk>...
> > > Your best bet would be to use as many representation attributes as are
> > > necessary. In general I would use both a representation clause and
> > > pragma pack
> >
> > No, that's pointless, if you use a complete rep clause, then it is
> > redundant to use pragma Pack since it won't have
> > any effect.



  reply	other threads:[~2001-11-01  1:58 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-10  8:05 Size and pack Adrian Hoe
2001-10-10  8:59 ` Alfred Hilscher
2001-10-10  9:50   ` John McCabe
2001-10-11  6:36     ` Adrian Hoe
2001-10-11  8:55       ` John McCabe
2001-10-31  1:53         ` Robert Dewar
2001-10-31  1:50     ` Robert Dewar
2001-10-31  9:17       ` John McCabe
2001-10-31 11:58       ` Jeff Creem
2001-11-01  1:58         ` Adrian Hoe [this message]
2001-11-01  2:34           ` Jeff Creem
2001-11-01 14:58             ` Marin David Condic
2001-11-01  3:53           ` Matthew Heaney
2001-11-01 18:37             ` Jeff Creem
2001-11-02  3:39               ` Robert Dewar
2001-11-01  3:45         ` Jeffrey Carter
2001-11-01  6:00         ` Robert Dewar
2001-10-10  9:24 ` Pi
2001-10-10  9:27 ` Lutz Donnerhacke
2001-10-11  6:24   ` Adrian Hoe
2001-10-11  8:58     ` John McCabe
2001-10-11 13:20       ` Mark Johnson
2001-10-11 16:23         ` John McCabe
2001-10-11 16:00           ` Pat Rogers
2001-10-12  8:37             ` John McCabe
2001-10-28  1:30         ` Robert Dewar
2001-10-11  9:30     ` Lutz Donnerhacke
2001-10-11 10:12 ` Vincent Smeets
2001-10-11 10:19   ` Lutz Donnerhacke
2001-10-11 11:18     ` David C. Hoos, Sr.
2001-10-11 12:06       ` Lutz Donnerhacke
2001-10-11 13:49 ` Ted Dennison
2001-10-26  4:00 ` Smark
2001-10-26  6:14   ` tmoran
2001-10-26 17:51     ` Smark
2001-10-26 23:21       ` Jeffrey Carter
2001-10-26 23:39       ` tmoran
2001-10-29  1:01         ` Adrian Hoe
2001-10-29  2:21           ` tmoran
2001-10-29 10:42             ` Adrian Hoe
2001-10-29 23:15               ` tmoran
2001-10-29  9:52         ` Lutz Donnerhacke
2001-10-29 10:29           ` Larry Kilgallen
2001-10-29 10:50             ` Lutz Donnerhacke
2001-10-29 11:12               ` Larry Kilgallen
2001-10-31  2:02                 ` Robert Dewar
2001-10-31  2:00               ` Robert Dewar
2001-10-31  2:51                 ` Larry Kilgallen
2001-10-31  1:59           ` Robert Dewar
2001-10-31  1:57       ` Robert Dewar
2001-10-31  1:55   ` Robert Dewar
replies disabled

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