Article View: comp.os.msdos.programmer
Article #8070Re: setting stack size under BC4.5
From: Steve Summit
Date: Fri, 27 Oct 2000 21:58
Date: Fri, 27 Oct 2000 21:58
33 lines
2415 bytes
2415 bytes
In article <8tb0mj$j4s$1@news.chorus.net>, Joe Hagen <jdhagen@chorus.net> writes: >[I had written:] >> This ought to be an easy question, but I'm drawing a blank >> digging through the documentation. What's the right way to >> set a non-default (i.e. bigger, to avoid overflows) stack size >> under BC++ 4.5? > > In your main module put the following line > at file scope: > extern unsigned _stklen=xxxx; Thanks. As a matter of fact, I had tried that, but since I wasn't sure it was right and it didn't seem to help, I didn't mention it at first. There are two possible reasons for a stack overflow, of course. One is that the stack isn't big enough for the call depth of your program, and one is that you've got an infinitely recursive call, that will chew up any stack, no matter how big. It looks like I had one of the latter. (Not in an obvious way, though; it looks like I picked a name for a new function of mine which matched a library function of some sort, and the combination of my function and the library's expectations for its function caused the infinite recursion. But changing the name of my function made the problem go away.) Also, thirty lashes with a wet noodle to me for neglecting to check the FAQ list for comp.os.msdos.programmer, which answers the question I asked, plain as day. Steve Summit scs@eskimo.com
Technical Details
Message-ID:
<8tctr2$2tt$1@eskinews.eskimo.com>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!europa.netcrusader.net!208.184.7.66!newsfeed.skycache.com!Cidera!news.eskimo.com!eskimo.com!scsReferences:
<8tavlc$ibh$1@eskinews.eskimo.com> <8tb0mj$j4s$1@news.chorus.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10f6aa,c6b41702e6080d53 X-Google-Attributes: gid10f6aa,public X-Google-Thread: fa69e,c6b41702e6080d53 X-Google-Attributes: gidfa69e,public X-Google-ArrivalTime: 2000-10-27 14:59:05 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!europa.netcrusader.net!208.184.7.66!newsfeed.skycache.com!Cidera!news.eskimo.com!eskimo.com!scs From: scs@eskimo.com (Steve Summit) Newsgroups: comp.os.msdos.programmer,borland.public.cpp.borlandcpp Subject: Re: setting stack size under BC4.5 Date: 27 Oct 2000 21:58:58 GMT Organization: when in doubt, laugh Lines: 33 Message-ID: <8tctr2$2tt$1@eskinews.eskimo.com> References: <8tavlc$ibh$1@eskinews.eskimo.com> <8tb0mj$j4s$1@news.chorus.net> NNTP-Posting-Host: eskimo.com X-Trace: eskinews.eskimo.com 972683938 3005 204.122.16.13 (27 Oct 2000 21:58:58 GMT) X-Complaints-To: abuse@eskimo.com NNTP-Posting-Date: 27 Oct 2000 21:58:58 GMT X-Gratuitous-Plug: for a great ISP, click http://www.eskimo.com/