From: Jacob Sparre Andersen <jacob@jacob-sparre.dk>
Subject: Bug in 'gnatmake' (Was: Range check for type 'Integer')
Date: Mon, 17 Jun 2013 15:23:11 +0200
Date: 2013-06-17T15:23:11+02:00 [thread overview]
Message-ID: <87r4g0g9c0.fsf@adaheads.sparre-andersen.dk> (raw)
In-Reply-To: 7f33982d-3bcf-452e-a3b3-3a0a28505ff1@x20g2000vbe.googlegroups.com
Peter Brooks wrote:
> This is 134217728
> This is 268435456
> This is 536870912
> This is 1073741824
> This is -2147483648
> This is 0
> This is 0
> This is 0
> This is 0
> This is 0
> This is 0
> This is 0
> This is 0
> ..... [forever]
>
> So the 'Integer' has rolled over to negative and then rolled back to 0
> - but with no run-time error.
>
> Why is there no range check error on type Integer?
Because there is a major error in the design of GNAT. You have to give
'gnatmake' a very specific set of command line flags to turn it into an
Ada compiler:
-fstack-check -- Generate stack checking code
-gnata -- Enable assertions
-gnatE -- Dynamic elaboration checking
-gnato -- Overflow checking
If you use the GNAT Project Manager (and '*.gpr' files), I suggest that
you copy this file project file and use it in all you (GNAT based) Ada
projects:
http://repositories.jacob-sparre.dk/ada-user-journal-tools/src/40323d1c952e20020bd056f2df698d252c4cd87f/ada_2012.gpr?at=default
Here is a simple example of how to use the file:
http://repositories.jacob-sparre.dk/ada-user-journal-tools/src/40323d1c952e20020bd056f2df698d252c4cd87f/auj_tools.gpr?at=default
The more complicated version has something like:
package Compiler is
for Default_Switches ("Ada")
use Ada_2012.Compiler'Default_Switches ("Ada") &
("-some-extra-switches");
end Compiler;
instead of:
package Compiler renames Ada_2012.Compiler;
Greetings,
Jacob
--
"Never interrupt your enemy when he is making a mistake."
next prev parent reply other threads:[~2013-06-17 13:23 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-17 10:57 Range check for type 'Integer' Peter Brooks
2013-06-17 11:23 ` Simon Clubley
2013-06-17 11:54 ` Simon Wright
2013-06-17 12:55 ` Peter Brooks
2013-06-17 13:28 ` Shark8
2013-06-17 13:45 ` Peter Brooks
2013-06-17 21:16 ` Shark8
2013-06-18 10:48 ` Stephen Leake
2013-06-17 12:46 ` Dmitry A. Kazakov
2013-06-17 13:23 ` Jacob Sparre Andersen [this message]
2013-06-17 13:32 ` Bug in 'gnatmake' Jacob Sparre Andersen
2013-06-17 16:50 ` Bug in 'gnatmake' (Was: Range check for type 'Integer') Robert A Duff
2013-06-17 19:15 ` Peter Brooks
2013-06-17 21:09 ` Shark8
2013-06-17 21:22 ` Jeffrey Carter
2013-06-18 1:21 ` Peter Brooks
2013-06-18 6:33 ` Jeffrey Carter
2013-06-18 7:29 ` Georg Bauhaus
2013-06-17 18:49 ` Bug in 'gnatmake' Simon Wright
2013-06-18 9:09 ` Elaboration order handling (Was: Bug in 'gnatmake') Jacob Sparre Andersen
2013-06-18 17:09 ` Robert A Duff
2013-06-18 22:52 ` Adam Beneschan
2013-06-19 1:21 ` Jeffrey Carter
2013-06-19 12:38 ` Robert A Duff
2013-06-19 20:43 ` Georg Bauhaus
2013-06-20 0:37 ` Robert A Duff
2013-06-20 19:56 ` Georg Bauhaus
2013-06-19 12:22 ` Robert A Duff
2013-06-19 15:46 ` Adam Beneschan
2013-06-19 16:41 ` Robert A Duff
2013-06-19 20:47 ` Georg Bauhaus
2013-06-19 21:36 ` Adam Beneschan
2013-06-20 0:57 ` Robert A Duff
2013-06-20 1:09 ` Jeffrey Carter
2013-06-20 2:29 ` Adam Beneschan
2013-06-20 6:08 ` Jeffrey Carter
2013-06-20 15:11 ` Robert A Duff
2013-06-21 5:26 ` Jeffrey Carter
2013-06-21 15:48 ` Adam Beneschan
2013-06-21 18:35 ` Jeffrey Carter
2013-06-21 19:10 ` Robert A Duff
2013-06-21 21:27 ` Jeffrey Carter
2013-06-21 20:43 ` Adam Beneschan
2013-06-21 21:44 ` Jeffrey Carter
2013-06-21 23:47 ` Robert A Duff
2013-06-23 14:43 ` AdaMagica
2013-06-21 18:58 ` null declarative parts (was: Re: Elaboration order handling) Robert A Duff
2013-06-21 20:42 ` null declarative parts Georg Bauhaus
2013-06-20 2:11 ` Elaboration order handling (Was: Bug in 'gnatmake') Adam Beneschan
2013-06-20 14:44 ` Robert A Duff
2013-06-20 11:24 ` G.B.
2013-06-20 15:23 ` Robert A Duff
2013-06-19 21:00 ` Georg Bauhaus
2013-06-19 22:26 ` Randy Brukardt
2013-06-20 0:31 ` Robert A Duff
2013-06-20 21:36 ` Randy Brukardt
2013-06-19 13:07 ` Bill Findlay
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox