TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Henk den Adel
from: Vladimir Djuzheff
date: 1997-03-27 23:17:12
subject: trap 0005

Hi Henk.

  We are too far from pure OS2, I fear it is not good... It seems to me,
you not very familiar with programming... mmm, are you sure that Os/2 is
better place to learn it?

 HdA> Suppose so. I'll change the struct a little, in such way it will be 4
 HdA> MB large. Then i'll recompile it again. I'll let you know.

  4Mb? How large it now? 2? :() Why don't you use malloc? Stack has two
good reason to store data on -- automatic destroying at return() and fact
that you do not need write -> (in C). But if you'll got a zero pointer
after malloc, you could do something with that, but if the same will take
place on stack, you'll got "stack overflow" in one case and
exception 0005 if you don't use stack checking. Anything more than 100
bytes should be allocated dinamically.

By the way, you don't need to set the value for your struct to find out
your unix compiler stack size -- just use recursion.

not checked -- just typed!
============ край земли ============
#include 

void Scaffold(long executed)
{
  char pie[1024];
  long executednow;

  executednow = executed+sizeof(pie);
  printf("executed more (total %8d)\n",executednow );
  Scaffold(executednow);
};

void main(){ Scaffold(0); }
============ край земли ============

P.S. Disable optimization! Else Watcom, f.ex., eliminate pie[1024], so,
you'll got wrong value. Or use pie somehow --
memset(pie,executed,sizeof(pie)) will be enough.

bye.   [Team OS/2]
dozen
SPb,Russia

--- FleetStreet 1.19 NR
* Origin: живи и дай умереть (2:5030/297.31)
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: 5030/297 110 48 16 464/34 5100/8 396/1 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™.