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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FREEMAIL_REPLY autolearn=no 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-14 21:38:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!news-hog.berkeley.edu!ucberkeley!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!news.xtra.co.nz!53ab2750!not-for-mail From: "AG" Newsgroups: comp.lang.ada References: <3DFB7841.F898C02@t-online.de> <3%KK9.53003$vM1.4249406@bgtnsc04-news.ops.worldnet.att.net> <3DFB89BF.323CB3E3@t-online.de> Subject: Re: CONSTRAINT_ERROR - why? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: <_yUK9.4690$Q11.78009@news.xtra.co.nz> Date: Sun, 15 Dec 2002 18:39:16 -0800 NNTP-Posting-Host: 210.54.95.47 X-Complaints-To: newsadmin@xtra.co.nz X-Trace: news.xtra.co.nz 1039930682 210.54.95.47 (Sun, 15 Dec 2002 18:38:02 NZDT) NNTP-Posting-Date: Sun, 15 Dec 2002 18:38:02 NZDT Organization: Xtra Xref: archiver1.google.com comp.lang.ada:31842 Date: 2002-12-15T18:39:16-08:00 List-Id: "Alfred Hilscher" wrote in message news:3DFB89BF.323CB3E3@t-online.de... > > > Robert A Duff schrieb: > > > > "James S. Rogers" writes: > > > > > "Alfred Hilscher" wrote in message > > > news:3DFB7841.F898C02@t-online.de... > > > > This program raises exception CONSTRAINT_ERROR for the second > > > > assignment. It happens with GNAT 3.13p and 3.14p (on windows). > > > > > > > > Can someone explain why? Is this a compiler error or do I misunderstand > > > > something? > > > > > > > > I would expect that the computation is done first and then the result > > > > (33 which is successfully assigned the statement before) is assigned. > > > > But it seems that the size (=264) is assigned before the division is > > > > executed. > > > > The 'Size is implicitly converted to BYTE, and then the "/" operator of > > type BYTE is used. You want to do the division in, say, Integer, > > and then explicitly convert to BYTE, like: > > > > ... := BYTE(Integer'(Fac_Conf_Struct'Size / 8)); > > Shouldn`t the conversion take place _after_ the computation? No. Because you need to know *which* division to use. And that depends on the types used ...