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,FREEMAIL_FROM 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-18 10:40:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.stueberl.de!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail From: Alfred Hilscher Newsgroups: comp.lang.ada Subject: Re: CONSTRAINT_ERROR - why? Date: Wed, 18 Dec 2002 19:36:48 +0100 Organization: T-Online Message-ID: <3E00C040.A038AFCE@t-online.de> References: <3DFB7841.F898C02@t-online.de> <3DFB8495.A655C512@t-online.de> <616gta.hk3.ln@beastie.ix.netcom.com> <3DFC878D.B6966C37@t-online.de> <2a9jta.1p3.ln@beastie.ix.netcom.com> <3DFD38A7.6080204@acm.org> <3DFE1FFB.E1BB660E@t-online.de> <3DFF6AFB.A536A0CE@t-online.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.t-online.com 1040236704 07 28439 U-31EH4GSHALVk 021218 18:38:24 X-Complaints-To: abuse@t-online.com X-Sender: 320001779794-0001@t-dialin.net X-Mailer: Mozilla 4.75 [de] (WinNT; U) X-Accept-Language: de Xref: archiver1.google.com comp.lang.ada:32040 Date: 2002-12-18T19:36:48+01:00 List-Id: Robert A Duff schrieb: > > Alfred Hilscher writes: > > > So could it be a way if I define a function "/" (a, b : Integer) return > > BYTE within my code? Or wouldn`t it be used? > > Probably both "/" operators would be directly visible, > so it would be ambiguous. What's wrong with this: > > X.Struct_Length := BYTE(Integer'(Fac_Conf_Struct'Size / 8)); I have written a lot of code and there a many such assignments, because the (C-)interface expects always the first component of a structure to contain the structure length in bytes. So I want reduce the effort to change the code. The main problem is, that GNAT does the compile without error and without warning (at least when invoked from AdaGide), and the exception is detected only during runtime (Aonix shows a warning during compilation). I had to write a lot of code before I could do the first run. If I'd got an warning during compilation then the problem had been detected in an early phase and the changes were minimal.