From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: CONSTRAINT_ERROR - why?
Date: Wed, 18 Dec 2002 18:51:30 GMT
Date: 2002-12-18T18:51:30+00:00 [thread overview]
Message-ID: <wcc8yyn40ul.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 3E00C040.A038AFCE@t-online.de
Alfred Hilscher <Alfred.Hilscher@t-online.de> writes:
> 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.
You're trying to convert a size in bits (of type universal_integer) to a
size in bytes (of type BYTE). And you're doing that all over the place.
So it seems to me you should encapsulate that operation. It's not hard
to write a function to do that. I also suggested a generic, which is a
bit heavy, but does the job. Yes, you'll have to change all your code
to refer to the encapsulated operation.
> 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.
Yes, I agree this is a language design flaw. I'm glad to hear the Aonix
compiler at least gave a warning (since I work for SofCheck, and Aonix
uses SofCheck's AdaMagic front end).
(Modular types are one of my least favorite features of Ada 95.)
- Bob
next prev parent reply other threads:[~2002-12-18 18:51 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-14 18:28 CONSTRAINT_ERROR - why? Alfred Hilscher
2002-12-14 18:45 ` James S. Rogers
2002-12-14 19:15 ` Robert A Duff
2002-12-14 19:20 ` James S. Rogers
2002-12-14 19:42 ` Alfred Hilscher
2002-12-16 2:39 ` AG
2002-12-14 19:20 ` Alfred Hilscher
2002-12-14 20:58 ` Dennis Lee Bieber
2002-12-15 13:45 ` Alfred Hilscher
2002-12-15 19:04 ` Robert A Duff
2002-12-16 1:12 ` Dennis Lee Bieber
2002-12-16 2:20 ` Jeffrey Carter
2002-12-16 18:48 ` Alfred Hilscher
2002-12-16 19:53 ` James S. Rogers
2002-12-17 18:20 ` Alfred Hilscher
2002-12-17 19:29 ` Robert A Duff
2002-12-17 21:05 ` Dennis Lee Bieber
2002-12-18 18:36 ` Alfred Hilscher
2002-12-18 18:51 ` Robert A Duff [this message]
2002-12-18 21:45 ` Randy Brukardt
2002-12-19 16:49 ` Robert Spooner
2002-12-19 20:57 ` Randy Brukardt
2002-12-14 20:19 ` Jeffrey Carter
2002-12-14 22:26 ` Alfred Hilscher
2002-12-15 0:49 ` Dennis Lee Bieber
2002-12-15 2:18 ` Jeffrey Carter
2002-12-15 18:23 ` Jeffrey Carter
2002-12-15 14:01 ` Alfred Hilscher
2002-12-15 18:20 ` Jeffrey Carter
2002-12-15 19:00 ` Alfred Hilscher
2002-12-16 1:16 ` Dennis Lee Bieber
2002-12-16 18:50 ` Alfred Hilscher
2002-12-17 2:17 ` Dennis Lee Bieber
2002-12-17 18:21 ` Alfred Hilscher
[not found] ` <26tuvu4ekeigls0bnd2okavrdhfu0tir4a@4ax.com>
2002-12-18 18:47 ` Alfred Hilscher
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox