Subject: lib/3448: malloc.c contains bogus preprocessor assumptions
To: None <>
From: Bill Sommerfeld <>
List: netbsd-bugs
Date: 04/04/1997 05:55:13
>Number:         3448
>Category:       lib
>Synopsis:       malloc.c contains bogus preprocessor assumptions
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr  3 22:05:01 1997
>Originator:     Bill Sommerfeld
>Release:        970325 or so
System: NetBSD 1.2C NetBSD 1.2C (ORCHARD) #19: Thu Mar 27 20:21:43 EST 1997 i386


malloc contains the following code which assumes a non-ANSI preprocessor:

	#define	ASSERT(p)   if (!(p)) botch("p")

	Compile malloc with -DDEBUG to let it catch attempts to free
	non-malloced memory.

	Actually, the two checks enabled by -DDEBUG are sufficiently
	useful that I don't understand why we run without them by

	They catch:
		Attempts to allocate "big, FLUFFY" chunks of memory
		(malloc(x) where ((signed)x) < 0).

		free(x) where x wasn't previously returned from
	if __STDC__, s/"p"/#p/
	or just give up on non-ANSI compilers.

					- Bill