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,7be3870dd9c9518f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-15 17:47:06 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn14feed!wn12feed!worldnet.att.net!207.217.77.102!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!harp.news.atl.earthlink.net!beastie.ix.netcom.com!nobody From: Dennis Lee Bieber Newsgroups: comp.lang.ada Subject: Re: CONSTRAINT_ERROR - why? Date: Sun, 15 Dec 2002 17:12:34 -0800 Organization: >> Leaf-Eating Penguins? << Message-ID: <2a9jta.1p3.ln@beastie.ix.netcom.com> References: <3DFB7841.F898C02@t-online.de> <3DFB8495.A655C512@t-online.de> <616gta.hk3.ln@beastie.ix.netcom.com> <3DFC878D.B6966C37@t-online.de> NNTP-Posting-Host: a5.f7.de.77 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Server-Date: 16 Dec 2002 01:47:06 GMT User-Agent: KNode/0.6.1 X-noarchive: yes Xref: archiver1.google.com comp.lang.ada:31863 Date: 2002-12-16T01:47:06+00:00 List-Id: Alfred Hilscher fed this fish to the penguins on Sunday 15 December 2002 05:45 am: > > > Dennis Lee Bieber schrieb: >> >> From the user guide: >> >> -gnato >> Enables overflow checking for integer operations. This causes GNAT >> to generate slower and larger executable programs by adding code to >> check for overflow (resulting in raising Constraint_Error as required >> by standard Ada semantics). These overflow checks correspond to >> situations in which the true value of the result of an operation may >> be > > "... the result of an operation ..." The result of the operation "/" > _does_ fit into a BYTE. > >> outside the base range of the result type. The following example >> shows the distinction: You stopped short of " *may* be outside"... I'll concede that I'd have thought the compiler could have made the determination -- given that the size of Fac_Conf_Struct is fixed at compile time. However, I expect the 'Size returns a value defined in some "type" (call it "size_type") which is probably 32-bit integer. So you have a 32-bit integer divided by an anoymous integer; the result of that division, based solely on the data types, /could/ exceed the result type BYTE. -- > ============================================================== < > wlfraed@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG < > wulfraed@dm.net | Bestiaria Support Staff < > ============================================================== < > Bestiaria Home Page: http://www.beastie.dm.net/ < > Home Page: http://www.dm.net/~wulfraed/ <