comp.lang.ada
 help / color / mirror / Atom feed
From: "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com>
To: <comp.lang.ada@ada.eu.org>
Cc: <dalepenn@hiwaay.net>
Subject: Re: Ada Compiler Complaint ?
Date: Tue, 28 Aug 2001 05:06:20 -0500
Date: 2001-08-28T05:06:20-05:00	[thread overview]
Message-ID: <mailman.998993202.10206.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: GUDi7.52672$54.2837690@e420r-atl1.usenetserver.com

Since file IO can only be done in whole bytes, what
was your intention in instantiating Integer_IO for
your Bit type?  E.g., ion which bit of each byte would
the data bit reside?

Incidentally, the type bit would probably be better defined
as mod 2 instead of range 0 .. 1.

----- Original Message -----
From: "Dale Pennington" <dalepenn@hiwaay.net>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada.eu.org>
Sent: August 27, 2001 10:02 PM
Subject: Ada Compiler Complaint ?


> Folks, looks like my company news server is acting wierd, so I am also
> posting from a home account. If this shows up twice, just ignore the second
> one.
>
> I have a chunk of code giving me an error I do not understand. The code is :
>
> package X
> ...
> type Bit is range (0..1);
> for Bit'Size use 1;
>
> type Bit_Array is array(1..20000) of Bit;
> pragma Pack(Bit_Array);
>
> type Bit_Array_Ptr is access Bit_Array;
>
> package Bit_Io is new Ada.Text_Io.Integer_Io(Bit);
>
> ...
>
> procedure Y
> ...
> A_Bit_Array : Bit_Array_Ptr;
> begin
> ...
> Bit_Io.Put(Outfile,A_Bit_Array(I),1);
> ...
> end Y;
> ...
> end package X;
>
> The compiler complains for the Bit_Io.Put instruction on the column
> A_Bit_Array starts :
> expected type "System.Unsigned_Types.Packed_Byte"
> found type "Bit" defined at xxx.
>
> Where xxx is the line the type Bit is at.
>
> Anyone know why the compiler is complaining, and what I can do about it ?
>
> Thanks
>
> Dale Pennington
>
>
>
>
>
>
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada
>




  reply	other threads:[~2001-08-28 10:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-28  3:02 Ada Compiler Complaint ? Dale Pennington
2001-08-28 10:06 ` David C. Hoos, Sr. [this message]
2001-08-28 10:32   ` Larry Kilgallen
2001-08-28 12:10   ` Dale Pennington
2001-08-28 14:33     ` David C. Hoos
replies disabled

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