ADA Compile Warning 
Author Message
 ADA Compile Warning

Gentlemen:

    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);"?

The module "base" has the following code:

--------------------------------------------------------------

"PACKAGE base IS

 --/ Visible Declarations.

 --/ Visible Constants.

   -- Note: Different on FE (PC)
   -- Left to right bit numbers within a byte.
   -- used for transportable boolean flag definitions.
   -- e.g.  FOR .. USE ..  Flag1  AT 0  B0..B0;

   B0              : CONSTANT := 7;
   B1              : CONSTANT := 6;
   B2              : CONSTANT := 5;
   B3              : CONSTANT := 4;
   B4              : CONSTANT := 3;
   B5              : CONSTANT := 2;
   B6              : CONSTANT := 1;
   B7              : CONSTANT := 0;

 --/ Visible Data Types.

 -- General Base Types

   SUBTYPE Boolean_type IS
   -- basic boolean type with possible values of 0 or 1
       BOOLEAN;

 -- Integer Base Types

   SUBTYPE Integer32_type IS
   -- Integer of 32 bits
      INTEGER;

   SUBTYPE Integer16_type IS
   -- Integer of 16 bits
      SHORT_INTEGER;

   SUBTYPE Integer8_type IS
   -- Integer of 8 bits
      TINY_INTEGER;

   SUBTYPE AddressInt_type IS INTEGER; -- Integer same size as an
address

 -- Float Base Types

   SUBTYPE Real64_type IS
   -- Real number of 64 bits
      FLOAT;

   SUBTYPE Real32_type IS
   -- Real number of 32 bits
      SHORT_FLOAT;

 -- Byte Base Types

   TYPE Byte_type IS NEW
   -- Byte type  of 8 bits, range 0 .. 255
      unsigned_types.Unsigned_Integer      
      RANGE 0..255;
   FOR Byte_type'SIZE USE 8;

   TYPE Byte_Array_type IS
   -- Array of bytes, each byte being 8 bits
      ARRAY( INTEGER RANGE <> ) OF Byte_type;
   PRAGMA PACK(Byte_Array_type);

   TYPE Byte_Array_Pointer IS ACCESS Byte_Array_type;

   SUBTYPE Word_type IS
   -- type word of 0.. 2**16-1 range
      unsigned_types.Unsigned_Integer
      RANGE 0..2**16-1;

   SUBTYPE Double_Word_Type IS
   -- type word of 0.. 2**32-1 range
      unsigned_types.Unsigned_Integer ;

 -- String Base Types

   TYPE String_Pointer_type IS
   -- Pointer to the ADA standard type string
      ACCESS STRING;

   SUBTYPE String_Index_type IS
      POSITIVE;
   -- String index type.  Must be same type as STRING index for each
system.

 -- Address Base Constants

   NULL_ADDR        : CONSTANT system.ADDRESS := system.NO_ADDR;
   -- Constant Null address assigned to the system's No Address

 --/ Visible Exceptions.

 PRIVATE

 --/ Private Declarations.

 END base;  --PACKAGE "

--------------------------------------------------------------

Any help would be appreciated.

Ron Rosenfeld



Mon, 19 Apr 2004 22:49:36 GMT  
 ADA Compile Warning

says...

Quote:
>    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.



Tue, 20 Apr 2004 01:01:52 GMT  
 ADA Compile Warning

Quote:


> 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.

Ted,

    Many thanks for your help. You asked me why I am using Integer_IO.
That's a good question. I don't know. I just inherited the software.
It does things in ways I don't understand. I tried your suggestion
with success.

Ron



Wed, 21 Apr 2004 01:42:18 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. CW2.003 - hand coded reports compile warning - help!

2. HELP!!! Compile Warnings and Errors

3. how to compile and a set of .prg file I am getting this warning

4. Warnings at compile time for possible runtime pattern matching failure

5. compile warning

6. rm/cobol85 compile warning

7. Warning compiling data structure

8. Problems with DVF (warning messages and compiling the wrong files)

9. Compiling warning ...

10. Compile time warnings

11. Suppressing LISP compile warnings

12. compiler warnings in clisp when compiling loop macro

 

 
Powered by phpBB® Forum Software