Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 May 1998 16:26:06 -0700 (PDT)
From:      Doug White <dwhite@gdi.uoregon.edu>
To:        Greg Pavelcak <gpavelcak@philos.umass.edu>
Cc:        Studded@san.rr.com, freebsd-questions@FreeBSD.ORG
Subject:   Re: malloc.h vs. stdlib.h
Message-ID:  <Pine.BSF.3.96.980506162431.6723A-100000@gdi.uoregon.edu>
In-Reply-To: <0ESK008T224FYU@rfd1.oit.umass.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 6 May 1998, Greg Pavelcak wrote:

> >> When compiling someone else's stuff I often see warnings to the effect
> >> of, "warning, this file includes malloc.h which is a bad thing, please
> >> use stdlib.h instead."  I am wondering if it's worthwhile to actually
> >> make that change in the software and recompile.  
> > 
> > Probably.  That way we're sure it's using our enhanced malloc instead of a
> > local reimplementation.
> > 
> I have seen this when installing ports too, and it seems strange to
> me.  Couldn't the code that generates that message just direct the
> compiler to use stdlib.h instead and revert to malloc.h if stdlib.h
> is missing? Or is it left as a message because people may want to
> decide on  a case by case basis which lib to use? Or perhaps it
> would just be really hard to do what I suggest.  (I'm not a
> programmer, so I hope you'll excuse me if this is stupid rambling.)

Well, that would probably be classified as a 'gratuitous change'.  There
may be changes in usage of the functions tho.

> If it isn't too difficult, is there something I can do on my
> own machine to make the switch from malloc.h to stdlib.h automatic.

You really should fix the broken program(s), but in a pinch you could try
symlinking stdlib.h to malloc.h so that they're basically the same file.
stdlib.h should have logic that prevents it from being included twice.
You'd have to test this.  Or, edit malloc.h and remove the #warning
directive.

Doug White                              | University of Oregon  
Internet:  dwhite@resnet.uoregon.edu    | Residence Networking Assistant
http://gladstone.uoregon.edu/~dwhite    | Computer Science Major



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.980506162431.6723A-100000>