Article View: comp.sys.ibm.pc
Article #8488Re: Microsoft C
From: Jeff Pipkins
Date: Tue, 12 Dec 1989 16:40
Date: Tue, 12 Dec 1989 16:40
23 lines
1454 bytes
1454 bytes
In article <3436@ccncsu.ColoState.EDU> massey@typhoon.atmos.colostate.edu (Todd Massey) writes:
>I need to know the exact code that makes up __chkstk in the
>libraries. The reason behind this is because everytime i make
>my own stack within a isr and call a routine written in c i get
>a runtime error caused by this routine that gives a stack overflow
>error
The __chkstk function ASSumes that you are using the stack setup by
the C startup code. If you use a different stack, it will... well, I
guess you know.
To prevent calls to __chkstk in your code, compile it with the "no stack
checking" option. If you have an assembly-language function that
calls a C function, and that C function makes a call to __chkstk (e.g.,
if it's a compiled library function), then define a dummy function
to keep the linker from linking in __chkstk. In C, just put
void __chkstk() { }
in the top of your file. This will prevent the linker from looking for
the __chkstk() function in the libraries.
Good luck.
Technical Details
Message-ID:
<64@qmsseq.imagen.com>Path:
arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!sun-barr!newstop!sun!imagen!qmsseq!pipkinsReferences:
<3436@ccncsu.ColoState.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!sun-barr!newstop!sun!imagen!qmsseq!pipkins From: pipkins@qmsseq.imagen.com (Jeff Pipkins) Newsgroups: comp.sys.ibm.pc Subject: Re: Microsoft C Message-ID: <64@qmsseq.imagen.com> Date: 12 Dec 89 16:40:48 GMT References: <3436@ccncsu.ColoState.EDU> Reply-To: pipkins@qmsseq.UUCP (Jeff Pipkins) Organization: QMS Inc., Mobile, Alabama Lines: 23