Path: utzoo!attcan!uunet!lll-winken!ames!mailrus!uflorida!gatech!emcard!stiatl!john From: john@stiatl.UUCP (John DeArmond) Newsgroups: comp.sys.ibm.pc Subject: Re: Replacing a Microsoft C library routine Keywords: C, Microsoft, link Message-ID: <2521@stiatl.UUCP> Date: 6 Jan 89 21:48:26 GMT References: <5041@b-tech.ann-arbor.mi.us> Reply-To: john@stiatl.UUCP (John DeArmond) Organization: Sales Technologies Inc., Atlanta, GA Lines: 43 In article <5041@b-tech.ann-arbor.mi.us> zeeff@b-tech.ann-arbor.mi.us (Jon Zeeff) writes: >For a few programs I've written, I believe that I need to disable >calls to chkstk (I'm calling microsoft C routines from an interrupt >handler). I know about the /Gs option, but I'm concerned that the >library routines might also call it. > >The best solution seems to be to write a null chkstk routine and link >it in. This creates an error message about multiply defined symbols. >Is there any way to get the linker to quietly use the first chkstk >routine it finds? > Use the /NOE linker switch. The multiply defined error message the linker generates tells you to use this switch. RTFM .. er ... RTFcrt :-) >I've tried removing chkstk from the library with -chkstk, but this seems >to remove some other needed routine or variable (STKHQQ). > >Are there any other ways to make sure that no routine calls chkstk? > >-- > Jon Zeeff zeeff@b-tech.ann-arbor.mi.us > Support ISO 8859/1 zeeff%b-tech.uucp@umix.cc.umich.edu > Ann Arbor, MI umix!b-tech!zeeff I'd recommend that you simply include an empty definition of _chkstk() for normal conditions and let the compiler include the call. I've found that this call is invaluable for debugging. Since it is called immediately before the function parameters are pushed, it is a very handy hook to attach debugging code to. The only time I've not let the compiler include the chkstk call is in EXTREMELY time critical routines. The only thing I wish is for Micro- Soft to include a similiar hook at the exit end of a function. john -- John De Armond, WD4OQC | "I can't drive 85!" Sales Technologies, Inc. Atlanta, GA | Sammy Hagar driving ...!gatech!stiatl!john | thru Atlanta!