From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,79db4ff72bff9422 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-25 04:40:13 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: joseph_kwan@greenlime.com (Joseph Kwan) Newsgroups: comp.lang.ada Subject: Re: How to convert record? Date: 25 Oct 2001 04:40:10 -0700 Organization: http://groups.google.com/ Message-ID: <80d2e34.0110250340.155ae0b7@posting.google.com> References: <80d2e34.0110210156.7918cd3d@posting.google.com> <3bd402f9.8783319@news.demon.co.uk> NNTP-Posting-Host: 202.188.209.38 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1004010010 13439 127.0.0.1 (25 Oct 2001 11:40:10 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 25 Oct 2001 11:40:10 GMT Xref: archiver1.google.com comp.lang.ada:15176 Date: 2001-10-25T11:40:10+00:00 List-Id: john.mccabe@emrad.com.nospam (John McCabe) wrote in message news:<3bd402f9.8783319@news.demon.co.uk>... > On 21 Oct 2001 02:56:25 -0700, joseph_kwan@greenlime.com (Joseph Kwan) > wrote: > > >I want to send a command buffer to serial port using florist's POSIX > >interface but I have encountered problems in converting record to > >POSIX.IO.IO_Buffer or Ada.Streams.Stream_Element_Array. How can I > >overcome this problem? > > Without looking at the Reference Manual, I would initially suggest > looking at Ada.Unchecked_Conversion to do the job. I thought that would work too but theoretically, Ada.Unchecked_Conversion will not work in converting record to POSIX.IO.IO_Buffer which is a string of characters (See spec in florist's implementation). Anyhow I tried to do Unchecked_Conversion and gnat gave me error message: "unchecked conversion to unconstrained array not allowed". What should I do?