From owner-freebsd-standards@FreeBSD.ORG Tue Feb 21 19:12:33 2006 Return-Path: X-Original-To: freebsd-standards@freebsd.org Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1D1C316A420 for ; Tue, 21 Feb 2006 19:12:33 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id B388A43D45 for ; Tue, 21 Feb 2006 19:12:32 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id k1LJCWhB007926; Tue, 21 Feb 2006 11:12:32 -0800 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id k1LJCWxG007925; Tue, 21 Feb 2006 11:12:32 -0800 Date: Tue, 21 Feb 2006 11:12:32 -0800 From: Brooks Davis To: pfgshield-freebsd@yahoo.com Message-ID: <20060221191232.GC31112@odin.ac.hmc.edu> References: <20060221184948.9554.qmail@web32906.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KDt/GgjP6HVcx58l" Content-Disposition: inline In-Reply-To: <20060221184948.9554.qmail@web32906.mail.mud.yahoo.com> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu Cc: freebsd-standards@freebsd.org Subject: Re: malloc.h is still legitimate after all X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2006 19:12:33 -0000 --KDt/GgjP6HVcx58l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 21, 2006 at 07:49:48PM +0100, pfgshield-freebsd@yahoo.com wrote: > Hi; > I was porting some parts of COIN-OR (some Operations Research packages > opensourced by IBM a while ago), and when I was happily suggesting that a= ll > occurences of malloc.h should be removed and/or replaced with stdlib.h I = got > this reply: The author is wrong. He's unconditionally including a non-standard header file in order to obtain a non-standard structure. Specificaly, there is no mallinfo structure on FreeBSD so he can apply what ever conditional he uses around that code around the include of malloc.h. You can verify the lock of mallinfo struct with this command: find /usr/include -type f | xargs grep mallinfo -- Brooks > ______________ > Pedro,=20 >=20 > The mallinfo struct that ReportMemory uses is defined in malloc.h, and not > brought in by stdlib.h.=20 >=20 > I'm testing on AIXv5.1, __STDC__ is defined, and "struct mallinfo" is unk= nown > if I don't include malloc.h.=20 >=20 > I don't know enough about the different flavors of UNIX (System V, POSIX,= BSD?) > to know what to do that satisfies all.=20 >=20 > The AIX docs say=20 >=20 > "The mallopt and mallinfo subroutines are provided for source-level > compatibility with the System V malloc subroutine "=20 >=20 > The gnu gcc docs say=20 >=20 > "This function and its associated data type are declared in `malloc.h'; t= hey > are an extension of the standard SVID/XPG version."=20 > ... > ___________ >=20 > So malloc.h will no be removed from the package but rather it will be und= ef'd > __FreeBSD__ and the package will still work on FreeBSD. I doubt we will e= ver > add these extensions, but there's also a glibc port for FreeBSD now so ma= ybe > __FreeBSD__ is not the correct variable here. >=20 > I personally think the FreeBSD port's people have contributed greatly to = clean > inappropiate uses of malloc.h in the software world, but perhaps an error= is > too drastic and we should fall back to a warning. >=20 > cheers, >=20 > Pedro. >=20 >=20 > --- > Pedro F. Giffuni > M. Sc. Industrial Eng. University of Pittsburgh > Mech. Eng. Universidad Nacional de Colombia > --- > Yahoo is powered by FreeBSD http://www.FreeBSD.org/ >=20 >=20 > =09 >=20 > =09 > =09 > ___________________________________=20 > Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB=20 > http://mail.yahoo.it > _______________________________________________ > freebsd-standards@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-standards > To unsubscribe, send any mail to "freebsd-standards-unsubscribe@freebsd.o= rg" --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --KDt/GgjP6HVcx58l Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFD+2YfXY6L6fI4GtQRAmZpAJ4k9I1diaqOJ2+TiidtlypqZEXvaACgwELA jj5unmTrARfPurNlcvY9wr8= =GqIM -----END PGP SIGNATURE----- --KDt/GgjP6HVcx58l--