comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: ada compiler?
Date: Mon, 12 Nov 2007 08:38:44 -0800
Date: 2007-11-12T08:38:44-08:00	[thread overview]
Message-ID: <1194885524.120844.198840@e34g2000pro.googlegroups.com> (raw)
In-Reply-To: <y4qdnVf5K_RaoajanZ2dnUVZ_hOdnZ2d@comcast.com>

On Nov 9, 9:08 pm, tmo...@acm.org wrote:
> > >Note that "-gnato -fstack-check" is needed for GNAT to be an Ada compiler.
>
> > Where did you get that one!
>
> >   I have never use "-gnato -fstack-check" and all programs that I have
> > created have work. May be you have some wrong on your system.
>
>   Try
> with ada.text_io;
> procedure isitada is
>   x : integer := integer'last-2;
> begin
>   ada.text_io.put("it is");
>   for i in 1 .. 3 loop
>     x := x+1;
>   end loop;
>   ada.text_io.put(" not Ada");
> exception
>   when constraint_error =>
>     ada.text_io.put_line(" Ada");
> end isitada;

I've noticed that in the argument that has ensued from this post (yes
it works fine, no it doesn't, it's real Ada, it isn't, it's high-
integrity or low-integrity mode blah blah blah), nobody has mentioned
what platform they're running on.  I'm not familiar with GNAT in great
detail, but it would seem to me that this is the sort of option where
the default would depend on the processor and OS.  On some processor/
OS combinations, it's fairly easy to get programs to raise an
exception when integer overflow occurs---because the processor is
capable of faulting when overflow happens, and the OS has ways of
letting the program trap the fault and map it to a Constraint_Error
exception.  On other processors or OS's, the facility isn't there, and
you can't implement this overflow without additional code, such as
doing a "branch if overflow bit is set in the condition code" after
every addition or subtraction.  (One processor I've worked with
doesn't even have an integer overflow status; to check for overflow we
had to perform two different kinds of additions and see if the results
were the same.)  On such platforms, the efficiency penalty for
implementing the checks required by the language is significant.
That's the reason for having an option like -gnato in the first
place.  But it would not surprise me that on some platforms, where
there is no efficiency penalty, that the overflow checking would be in
effect whether it's explicitly specified on the command line or not.
There wouldn't be any reason to turn it off.

                            -- Adam




  parent reply	other threads:[~2007-11-12 16:38 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-09 22:25 ada compiler? Bill Cunningham
2007-11-09 22:39 ` anon
2007-11-09 22:59   ` Bill Cunningham
2007-11-09 23:28     ` anon
2007-11-09 23:50 ` Jeffrey R. Carter
2007-11-10  0:32   ` anon
2007-11-10  4:15     ` Jeffrey Creem
2007-11-10  5:08     ` tmoran
2007-11-10  6:12       ` anon
2007-11-10  8:35         ` tmoran
2007-11-10 20:20           ` anon
2007-11-10 22:15             ` Jeffrey Creem
2007-11-11  1:01               ` anon
2007-11-11  1:14                 ` (see below)
2007-11-11  2:21                 ` Georg Bauhaus
2007-11-11  4:08                   ` Jeffrey R. Carter
2007-11-13 13:24                     ` Ludovic Brenta
2007-11-14  7:00                       ` Jacob Sparre Andersen
2007-11-14  9:15                         ` Georg Bauhaus
2007-11-14 10:26                           ` Ludovic Brenta
2007-11-14 12:25                             ` Georg Bauhaus
2007-11-14 15:09                               ` Ludovic Brenta
2007-11-14 16:03                                 ` Georg Bauhaus
2007-11-14 16:36                                   ` Ludovic Brenta
2007-11-14 17:39                                     ` Georg Bauhaus
2007-11-14 20:40                                       ` Ludovic Brenta
2007-11-15  9:59                                         ` Georg Bauhaus
2007-11-14 17:52                                     ` Georg Bauhaus
2007-11-16  1:07                                     ` Samuel Tardieu
2007-11-16  1:58                                       ` tmoran
2007-11-16  9:41                                       ` Stack checking in GNAT (was: ada compiler?) Ludovic Brenta
2007-11-16 10:56                                         ` Stack checking in GNAT Samuel Tardieu
2007-11-16 13:04                                           ` Ludovic Brenta
2007-11-17  7:24                                             ` anon
2007-11-29  0:32                                         ` Robert A Duff
2007-11-17  1:37                                       ` ada compiler? Randy Brukardt
2007-11-17  1:18                                     ` Randy Brukardt
2007-11-29  0:41                                     ` Robert A Duff
2007-11-14 21:31                                 ` Niklas Holsti
2007-11-17  1:50                                   ` Randy Brukardt
2007-11-14 18:33                         ` anon
2007-11-12  5:13                   ` anon
2007-11-11 14:15                 ` Jeffrey Creem
2007-11-13  7:11                 ` Martin Krischik
2007-11-13  8:47                   ` anon
2007-11-13  9:34                     ` to gnat make or not to gnat make (Was: ada compiler?) Martin Krischik
2007-11-13 22:46                       ` anon
2007-11-13 23:14                         ` to gnat make or not to gnat make Simon Wright
2007-11-14  9:21                         ` to gnat make or not to gnat make (Was: ada compiler?) Georg Bauhaus
2007-11-13 22:41                     ` ada compiler? Simon Wright
2007-11-17  2:07                     ` Randy Brukardt
2007-11-17  7:51                       ` anon
2007-11-17  9:00                         ` Pascal Obry
2007-11-17 12:24                         ` Ludovic Brenta
2007-11-19 21:35                           ` Randy Brukardt
2007-11-10 15:03         ` (see below)
2007-11-12 16:38       ` Adam Beneschan [this message]
2007-11-13  3:16         ` John W. Kennedy
2007-11-13 16:46           ` Adam Beneschan
2007-11-10  3:07 ` Georg Bauhaus
2007-11-13  0:20 ` adaworks
2007-11-13 22:27   ` Simon Wright
2007-11-14 17:32   ` Britt Snodgrass
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox