lint on malloc calls

Michael T Sullivan sullivan at vsi.UUCP
Tue Sep 20 12:07:11 AEST 1988


In article <781 at proxftl.UUCP>, bill at proxftl.UUCP (T. William Wells) writes:
> I don't see why this is being debated any longer.  I suggested
> adding the following kludge to each file where malloc is used:
> 
> #ifdef lint
> #define malloc(x) 0
> #endif

Sorry, I was on vacation and didn't get to participate in the early goings.
Actually, to be complete do this:

#ifdef lint
#define	malloc(x)	0
#else
extern char	*malloc();	/* or void* if that's what it is	*/
#endif

This eliminates the need for people to declare malloc in their programs,
which would look pretty silly if you just #define'd malloc to be 0:

extern char	*0;

-- 
Michael Sullivan				{uunet|attmail}!vsi!sullivan
V-Systems, Inc. Santa Ana, CA			sullivan at vsi.com
whump, whump, whump, whump, whump, whump, whump, whump, whump, whump, whump



More information about the Comp.lang.c mailing list