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,43bc631fb4a56c2a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-07 06:01:23 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!paloalto-snh1.gtei.net!lsanca1-snf1!news.gtei.net!newsfeed2.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3B1F6E47.617722A2@earthlink.net> From: "Marc A. Criley" Organization: Quadrus Corporation X-Mailer: Mozilla 4.73 [en] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Unchecked_Conversion References: <9fnbtt$ild$1@e3k.asi.ansaldo.it> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 07 Jun 2001 13:01:23 GMT NNTP-Posting-Host: 63.178.180.41 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 991918883 63.178.180.41 (Thu, 07 Jun 2001 06:01:23 PDT) NNTP-Posting-Date: Thu, 07 Jun 2001 06:01:23 PDT X-Received-Date: Thu, 07 Jun 2001 05:59:25 PDT (newsmaster1.prod.itd.earthlink.net) Xref: archiver1.google.com comp.lang.ada:8311 Date: 2001-06-07T13:01:23+00:00 List-Id: Lele wrote: > > Hi! > I'm a misterious reader...just because I've read for a month this NG without > take part. > I'm a beginner ADA programmer (what a wonderful language!) and I've a > problem... > > I should convert data types and record data types from one type to another, > since now I've > used the address attribute to point the same memory space and so accede to > from one type > to another. Ada provides features for bypassing certain language > restrictions and these > features are unchecked; it is the programmer's responsibility to make sure > that they do > not violate the assumptions of the rest of the program. Are there particular > risks about using Unchecked_Conversion? Is it a better approach the address > attribute? > > Thanks! Unchecked_Conversion is almost always a better approach than using the 'Address attribute. However, the need to do a significant amount of converting from one type to another suggests that perhaps a second look at the implementation approach is warranted. Forcing conversions between types is usually appropriate only in certain very specific domains, such as interfacing to operating system functions. The great majority of software written in Ada contains no such conversions. What kind of software are you writing? Marc A. Criley Senior Staff Engineer Quadrus Corporation www.quadruscorp.com