comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison<dennison@telepath.com>
Subject: Re: ADA Compile Warning
Date: Thu, 01 Nov 2001 17:01:52 GMT
Date: 2001-11-01T17:01:52+00:00	[thread overview]
Message-ID: <4efE7.8816$xS6.11821@www.newsranger.com> (raw)
In-Reply-To: 4ccfed40.0111010649.3f98d88@posting.google.com

In article <4ccfed40.0111010649.3f98d88@posting.google.com>, Ronald Rosenfeld
says...
>    Perhaps someone can help. We use a Rational VADSself Version
>6.2.1. ADA compiler for DEC RISC Ultrix machines. When compiling the
>following piece of code:
>
>"WITH text_io;  -- WITHs must precede each new package declaration
> WITH base;
> PACKAGE byte_io IS NEW text_io.integer_io (base.byte_type);",
>
>we get the following warning:
>
>"warning: Appendix F: representation of actual prevents code sharing".
>
>Why is the warning pointing to "NEW text_io.integer_io
>(base.byte_type);"?

This is essentially saying: "Normally, I would share some code between this
generic instantiation of Text_IO.Integer_IO and all other such instantiations to
save space. However, I'm unable to do that in this case because of the way
base.byte_type is defined. Thus I'm going to have to create a separate copy of
all the code inside the generic."

This isn't a really big problem, unless you are making lots of Integer_IO
instantiations. Most Ada compilers don't even implement this generic sharing at
all, so the fact that this one can't do it in this case is really of little
concern.

However, since you appear to be a newbie (based on your capitilzation of "Ada"),
I'd like to ask *why* you are using Integer_IO in the first place. If you just
need a string representation of your integer-derived type,
"Base.Base_Type'image" would do the job much easier. Integer_IO is really only
for situations where you want to display the value in a specific format, or in a
base other than 10.

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html

No trees were killed in the sending of this message. 
However a large number of electrons were terribly inconvenienced.



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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-01 14:49 ADA Compile Warning Ronald Rosenfeld
2001-11-01 17:01 ` Ted Dennison [this message]
2001-11-02 17:42   ` Ronald Rosenfeld
replies disabled

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