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.4 required=5.0 tests=BAYES_00,INVALID_DATE, UNRESOLVED_TEMPLATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e258612d447226e4,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-11-18 09:22:20 PST Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!gatech!udel!news.mathworks.com!zombie.ncsc.mil!paladin.american.edu!auvm!EUROCONTROL.DE!wel Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU Newsgroups: comp.lang.ada Message-ID: <9411181527.AA08827@eurocontrol.de> Date: Fri, 18 Nov 1994 16:27:49 +0100 Sender: Ada programming language From: Bob Wells #402 Subject: Range Check Query Comments: To: INFO-ADA%NDSUVM1.BITNET@vm.gmd.de Date: 1994-11-18T16:27:49+01:00 List-Id: G'day everyone, Hope you're all having a lovely Friday! Why does the following not raise a Constraint_Error exception? (It doesn't even raise a compile time warning) type dn18906 is -- layout is for the 18906 message . record dnspare : integer range 0 .. 1; dnspare2 : integer range 0 .. 3; dnch1 : integer range 0 .. (2**7) - 1; dnch2 : integer range 0 .. (2**7) - 1; end record; for dn18906 use record at mod 1; dnspare at 0 range 0 .. 1; dnspare2 at 0 range 2 .. 7; dnch1 at 0 range 8 .. 15; dnch2 at 0 range 16 .. 23; end record; for dn18906'size use 24; type Dn_189_Data is array(1 .. N_Data) of Dn18906; pragma Pack(Dn_189_Data); M_T : Dn_189_Data; for M_T use at P_Mesg_Conv(P_Ohead) + 12; P_Mesg_Conv is an Unchecked_Conversion of an access type to a system address. The access type points to an incoming byte stream. As Bart Simpson says "I didn't do it, I didn't do it!" That is, I've been "lucky" enough to inherit this code. OK, then in the body of this package we have: if M_T(1).Dnspare = 2 then -- do something end if; The incoming stream definitely has value of 2 occaisionaly in this component yet it doesn't raise Constraint_Error? Once again we are using the Verdix Ada Compiler, Copyright 1984, 1992 VADSworks for Sun-4 -> MC68020/30/vxWorks, (VADS 6.0.5) Mon Aug 17 09:11:00 EST 1992 2.0.3(b) Any help would be greatly appreciated. Thanks and 'avagoodweegend! @ -------- @ //// - ( G'day! ) @ (o o) -------- @ ----oOO--(_)--OOo-------------------------------------------------------- Bob Wells "There are more things in heaven and earth than are dreamt of in your philosophy." @ INTERNET: wel@eurocontrol.de CompuServe: 100272,3004 @ The Ada WWW Server is http://lglwww.epfl.ch/Ada/ Team Ada @ For exciting Ada info enter 'finger wel@s4ecawel.eurocontrol.de'