comp.lang.ada
 help / color / mirror / Atom feed
From: Colossus.Pike@worldnet.att.net (anon)
Subject: Re: ada compiler?
Date: Wed, 14 Nov 2007 18:33:09 GMT
Date: 2007-11-14T18:33:09+00:00	[thread overview]
Message-ID: <FbH_i.22888$if6.7153@bgtnsc05-news.ops.worldnet.att.net> (raw)
In-Reply-To: yger6ite2fu.fsf@hugsarin.dmusyd.edu

Note to Ludovic Brenta! I will post an answer for you tonight. Actually 
it can be done with altering a couple lines of code.  And rebuilding of 
the compiler. The first part is in "System.ads" and is documented in 
this post. For you look for <Part 1>  . 

Now for others:

The discussion was about rather a person should teach a newness to use

  gnatmake -gnato -fstack-check <name>

at first. Or wait to see if they need the 

    -fstack-check

option.  The RM considers this to be the nonstandard way!

Note: There are two version of "stack checking". The '-fstack-check' 
is a GNAT compiler option while '-lfstack-check; is a GCC linker 
option.  They work a little differently.  The GNAT version includes an 
Ada written stack checking code.  While the GCC version uses GCC 
built-in routines.

So, should a newbee they be taught to use command line option or 
be taught to use the Ada Standard pragma:

  pragma Linker_Options ( "-fstack-check" ) ;

within the main procedure and skip using the command line option. 
This way the option is documented and can be easily commented to 
aid the software maintainers. And this version uses the GCC stack 
checking routine.


<Part 1>

But To answer your question. In GNAT it is possible to set the stack 
checking to default by just changing the statement:

   Stack_Check_Default       : constant Boolean := False;

to 'True' in the private section of the "System.ads". Then rebuild the 
'Adalib'.  Should take less than 20 minutes. This adds by default the 
GNAT version of stack_checking. Then to test it use the '-RTS' 
command line option.  Using alternative libraries is this way 
that Ada RM suggest it, be done.

Also, in the GNAT "VMS / POSIX / LYNXOS" runtime code there is a 
special procedure that handles the stack checking, in the other 
versions the procedure just contains a "null' statement. 
<end Part 1>

This default could be easy be included as an option in the build 
configuration script for GCC.  But its already there, been there 
for longer than 10 years for GCC! 

The problem is that most people just download a stocked binary 
version of GNAT which defaults to no stack checking and look to 
the old 'C' language way to handle things aka command line option. 

The bigger issue is, in Ada the programmer should know and allocate 
the correct amount of stack and other memory needed which is also 
implied in the RM of writting efficient code.


In <yger6ite2fu.fsf@hugsarin.dmusyd.edu>, Jacob Sparre Andersen <sparre@nbi.dk> writes:
>Ludovic Brenta wrote:
>>> Georg Bauhaus wrote:
>
>>>> Wouldn't this be even more evidence in favor of having -gnato
>>>> -fstack-check on by default?
>
>> I'm starting to consider such a change for Debian gnat.  Overflow
>> checks can be disabled explicitly with -gnatp or pragma Suppress.
>> However, some programs don't compile with -fstack-check because some
>> stack frames are "too big" (whatever that means).  Thoughts?
>
>Would it be too big a change to add a new option to negate a default
>"-fstack-check"?
>
>I can only remember a _warning_ about a too big stack frame; not a
>plain compilation error.  Are you sure programs actually don't compile
>because of too big stack frames in some cases?
>
>Greetings,
>
>Jacob
>-- 
>"It ain't rocket science!"




  parent reply	other threads:[~2007-11-14 18:33 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 [this message]
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
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