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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f71c159449d6e114 X-Google-Attributes: gid103376,public From: Ted Dennison Subject: Re: Ada 83 - avoiding unchecked conversions. Date: 1996/12/02 Message-ID: <32A311C1.41C67EA6@escmail.orl.lmco.com>#1/1 X-Deja-AN: 203312183 references: <329C63BC.41C6@lmco.com> content-type: text/plain; charset=us-ascii organization: Lockheed Martin Information Systems mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 3.0 (X11; I; SunOS 4.1.3_U1 sun4m) Date: 1996-12-02T00:00:00+00:00 List-Id: Ensco Vendor wrote: > > we have two 16 bit integers which we need to assemble into a single 32 > bit integer (one is high order, the other low order). We wish to avoid > unchecked conversion if we can. Is there a standard accepted way of > doing this? > Does the target object have to be a 32-bit integer, or does it just have to be the *size* of a 32-bit integer? Often times folks will back themselves into a corner where they have to do unchecked conversion because they didn't choose their data types very well. Of course, often there is some sort of I/O or system binding that REQUIRES use of an unnatural data type. In that case, unchecked conversion is the proper tool for the job. Doing any kind of semantic calisthenics simply to aviod unchecked conversion is liable to cause more problems than are solved. -- T.E.D. | Work - mailto:dennison@escmail.orl.lmco.com | | Home - mailto:dennison@iag.net | | URL - http://www.iag.net/~dennison |