Path: utzoo!attcan!uunet!vsi!sullivan
From: sullivan@vsi.UUCP (Michael T Sullivan)
Newsgroups: comp.lang.c
Subject: Re: lint on malloc calls
Summary: One more little nibblet
Keywords: lint, malloc, alignment
Message-ID: <846@vsi.UUCP>
Date: 20 Sep 88 02:07:11 GMT
References: <39617@linus.UUCP> <9900007@bradley> <216@iaoobelix.UUCP> <781@proxftl.UUCP>
Organization: V-Systems, Inc. -- Santa Ana, CA
Lines: 26

In article <781@proxftl.UUCP>, bill@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@vsi.com
whump, whump, whump, whump, whump, whump, whump, whump, whump, whump, whump