TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Paul Edwards
from: Henk den Adel
date: 1997-03-20 22:38:54
subject: trap 0005

Hi Paul,

You wrote me:

 PE> If you ignore recursion,

I do. There is no recursive function involved. Sri, i forgot to tell you.

 PE> the maximum amount of stack size you can use is to have every single
 PE> function get called, in one big chain, in which case, the stack size is
 PE> the sum of all the local variables in all your functions. Normally, this
 PE> will be vast overkill.

Ok, but it yields a sufficient amount of stack.

 PE> If your source is in multiple files (hence multiple object code),

The program has the following structure:

===================================
standard header files
main
functions
include yet another bunch of functions
===================================

It does not matter whether i include these functions manually in the editor
or let the C compiler do the trick. It is one .obj file in either case.

 PE> Much easier to allow the user to specify the stack size!

Using an iterative method to determine the approximate stack size. :-(

 PE> icc /B"/stack:50000" fred.c

That works. The reason why i'm amazed is that Unix can determine the
correct or a sufficiently large amount of stack, and OS/2 seemingly can't.
I thought i might have been forgotten a compiler switch...


73 es cuagn,
 Henk

--- GoldED 2.50+
* Origin: Henks Toolbox (00-06h), Mail only (2:286/415)
SEEN-BY: 50/99 54/99 270/101 620/243 625/155 711/401 413 430 934 712/311 407
SEEN-BY: 712/505 506 517 623 624 704 713/317 800/1
@PATH: 286/415 4 700 280/801 270/101 712/624 711/934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.