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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6c7dea22b75ba442 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wn13feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: Colossus.Pike@worldnet.att.net (anon) Subject: Re: ada compiler? Reply-To: anon@anon.org (anon) References: X-Newsreader: IBM NewsReader/2 2.0 Message-ID: Date: Wed, 14 Nov 2007 18:33:09 GMT NNTP-Posting-Host: 12.64.60.234 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1195065189 12.64.60.234 (Wed, 14 Nov 2007 18:33:09 GMT) NNTP-Posting-Date: Wed, 14 Nov 2007 18:33:09 GMT Organization: AT&T Worldnet Xref: g2news1.google.com comp.lang.ada:18383 Date: 2007-11-14T18:33:09+00:00 List-Id: 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 . Now for others: The discussion was about rather a person should teach a newness to use gnatmake -gnato -fstack-check 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. 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. 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 , Jacob Sparre Andersen 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!"