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-Thread: a07f3367d7,865c3d125a8dbc3b X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.glorb.com!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!uio.no!fi.sn.net!newsfeed2.tdcnet.fi!news.song.fi!not-for-mail Date: Sun, 31 May 2009 23:39:48 +0300 From: Niklas Holsti User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20060628 Debian/1.7.8-1sarge7.1 X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Howto read line from a stream References: <83317a97-dae5-4c84-a1ac-88a87833cf3f@q14g2000vbn.googlegroups.com> <03bab021-0df6-445b-b2f7-7a3ab770448c@b1g2000vbc.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4a22eaee$0$24783$4f793bc4@news.tdc.fi> Organization: TDC Internet Services NNTP-Posting-Host: 81.17.205.61 X-Trace: 1243802350 news.tdc.fi 24783 81.17.205.61:32830 X-Complaints-To: abuse@tdcnet.fi Xref: g2news2.google.com comp.lang.ada:6141 Date: 2009-05-31T23:39:48+03:00 List-Id: Dmitry A. Kazakov wrote: > I am not a language lawyer, but I remember a DSP processor with > sizeof(char)=4. Apologies for picking a nit, but that can't be the case for a standard-conforming C implementation -- the C standard mandates that sizeof(char) = 1 because "sizeof" uses the size of "char" as its unit of measurement. No doubt you mean that "char" objects on this DSP were 32 bits = 4 octets. I know that at least one GCC port for the Analog Devices ADSP-21020 had such "char" objects. Since that processor only has 32-bit word addressing a smaller size for "char" would have required the C compiler to invent its own "octet address" type, with much complication and overhead. I believe that an Ada compiler could do that with less overhead, because the internal structure of access values is better hidden than in C. Perhaps an Ada compiler could choose 8-bit stream elements for such processors, with tolerable overhead. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .