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, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6da15369b6c53c77 X-Google-Attributes: gid103376,public From: Ted Dennison Subject: Re: LLQ: -1 a valid boolean? Date: 2000/05/23 Message-ID: <8geplk$10e$1@nnrp1.deja.com>#1/1 X-Deja-AN: 626289508 References: <39253CD0.C8DC893D@telepath.com> <8g8o3b$9l0$1@nnrp1.deja.com> <8ge39b$g45$1@nnrp1.deja.com> <8gen6a$v72$1@nnrp1.deja.com> X-Http-Proxy: 1.0 x63.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Tue May 23 20:28:53 2000 GMT X-MyDeja-Info: XMYDJUIDtedennison Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.7 [en] (WinNT; I) Date: 2000-05-23T00:00:00+00:00 List-Id: In article <8gen6a$v72$1@nnrp1.deja.com>, Robert Dewar wrote: > In article <8ge39b$g45$1@nnrp1.deja.com>, > Ted Dennison wrote: > > I just ended up doing the following, which looks damn silly > > (so I had to comment it copiously), but works: > > > if To_Bool_Ptr(Addr).all then > > It's not only silly, it is incorrect. There is absolutely NO > reason to think this should work correctly, since you are > testing an out of range and hence abnormal value, and the > result of this test is undefined. Ahh, that's a different kettle of fish. I thought the verdict was that this was a valid test, since Boolean'Size is 1, but that assigning it was wrong becuse Boolean_Object'Size > 1. So you are saying both are wrong? That's exactly what I was asking about. > Writing erroneous code like this and being satisied that it > happens to work on the particular compiler you are using is > not a good approach to writing reliable code! Quite so. The last thing I want is to be called out to timbucktoo for a week to figure out why part of the simulator fails 6 weeks after they take a minor compiler upgrade. Worse yet would be to inflict that fate on some other innocent engineer. -- T.E.D. http://www.telepath.com/~dennison/Ted/TED.html Sent via Deja.com http://www.deja.com/ Before you buy.