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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!fx19.iad.POSTED!not-for-mail From: Shark8 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:30.0) Gecko/20100101 Thunderbird/30.0a1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Troubles with C strings References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: X-Complaints-To: abuse@teranews.com NNTP-Posting-Date: Sat, 26 Jul 2014 15:15:47 UTC Organization: TeraNews.com Date: Sat, 26 Jul 2014 09:15:48 -0600 X-Received-Bytes: 1330 X-Received-Body-CRC: 1481824399 Xref: news.eternal-september.org comp.lang.ada:21247 Date: 2014-07-26T09:15:48-06:00 List-Id: On 26-Jul-14 08:13, Victor Porton wrote: > Also: It seems that in Interfaces.C.Strings there is no function which > creates an Ada string of specified length from a chars_ptr (without checking > for NUL). Addition of such a function would be good, because it can be very > fast (on some platforms it can be implemented as memcpy). Such a function cannot exist: to determine the length of a C-style string you *must* scan through it for the terminating NULL. What you describe would be a "substring" method that can read beyond the string-bounds without raising an error... and I see no way that would end well.