Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!dsinc!netnews.upenn.edu!eniac.seas.upenn.edu!weisen From: weisen@eniac.seas.upenn.edu (Neil Weisenfeld) Newsgroups: comp.sys.ibm.pc.programmer Subject: Re: NULL pointer error Keywords: Null dos error Message-ID: <27151@netnews.upenn.edu> Date: 16 Jul 90 23:40:59 GMT References: <2008@bnlux0.bnl.gov> <4ba0b259.20b6d@apollo.HP.COM> Sender: news@netnews.upenn.edu Reply-To: weisen@eniac.seas.upenn.edu.UUCP (Neil Weisenfeld) Organization: University of Pennsylvania Lines: 28 In article <4ba0b259.20b6d@apollo.HP.COM> geiser@apollo.HP.COM (Wayne Geiser) writes: > >What I have done in my Microsoft C programs to help find such problems is to >add the following line at the end of each routine: > >assert(_nullcheck()); > >If you don't want the assertion there in released code, put a #ifdef around it. >This line will call the Microsoft runtime routine to check the section of >memory everyone's been describing here and tell you the file and line number >when it does occur. Why not just use the ifdef that's there? The assert macro expands to a call with #ifdef NDEBUG around it. Defining NDEBUG will keep the assertion from being compiled in. Neil P.S. -- Thanks for the _nullcheck tip. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Neil I. Weisenfeld | InterNet: weisen@eniac.seas.upenn.edu Dept. of Computer and Info. Sciences | USPS: I dunno, I'm moving... University of Pennsylvania | PENNmail: Don't even try it... =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=