From owner-freebsd-questions Wed May 6 16:26:30 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA14221 for freebsd-questions-outgoing; Wed, 6 May 1998 16:26:30 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from gdi.uoregon.edu (gdi.uoregon.edu [128.223.170.30]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA14188 for ; Wed, 6 May 1998 16:26:15 -0700 (PDT) (envelope-from dwhite@gdi.uoregon.edu) Received: from localhost (dwhite@localhost) by gdi.uoregon.edu (8.8.7/8.8.8) with SMTP id QAA06796; Wed, 6 May 1998 16:26:06 -0700 (PDT) (envelope-from dwhite@gdi.uoregon.edu) Date: Wed, 6 May 1998 16:26:06 -0700 (PDT) From: Doug White Reply-To: Doug White To: Greg Pavelcak cc: Studded@san.rr.com, freebsd-questions@FreeBSD.ORG Subject: Re: malloc.h vs. stdlib.h In-Reply-To: <0ESK008T224FYU@rfd1.oit.umass.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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