From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12574 invoked by alias); 14 Oct 2013 18:04:46 -0000 Mailing-List: contact sid-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: sid-owner@sourceware.org Received: (qmail 12523 invoked by uid 89); 14 Oct 2013 18:04:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=unavailable version=3.3.2 X-Spam-User: qpsmtpd, 4 recipients X-HELO: smtp.gentoo.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 14 Oct 2013 18:04:45 +0000 Received: from vapier.localnet (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 0A1E033EA66; Mon, 14 Oct 2013 18:04:43 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: Re: [libiberty] xmalloc cannot return NULL Date: Mon, 14 Oct 2013 18:04:00 -0000 User-Agent: KMail/1.13.7 (Linux/3.10.6; KDE/4.6.5; x86_64; ; ) Cc: Marc Glisse , sid@sourceware.org, newlib@sourceware.org, binutils@sourceware.org, gcc-patches@gcc.gnu.org References: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart172744395.y0HCXvDVWQ"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201310141404.45773.vapier@gentoo.org> X-SW-Source: 2013-q4/txt/msg00002.txt.bz2 --nextPart172744395.y0HCXvDVWQ Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-length: 1078 On Monday 14 October 2013 13:59:16 Marc Glisse wrote: > libiberty provides a function xmalloc that never returns NULL. However, > there are some hints that it might be ok if someone wants to supply their > own xmalloc that can return NULL (though that would break a lot of things, > including in libiberty itself). >=20 > I would like to remove that freedom, and the point of this email (I hope > it doesn't bounce from too many of these addresses) is to ask all > libiberty users if that would cause problems for them. I already heard > from gcc and gdb that they are happy forbidding a null return value from > xmalloc. >=20 > Why do I want to do that? I just added an attribute "returns_nonnull" to > gcc and would like to mark relevant functions, to let the compiler > optimize based on this property. >=20 > http://gcc.gnu.org/ml/gcc-patches/2013-10/msg00817.html makes sense to me. as you point out, we write code based on the assumption= =20 that NULL is never returned (although, perhaps phrased more accurately, tha= t=20 the pointer returned is always valid). -mike --nextPart172744395.y0HCXvDVWQ Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. Content-length: 836 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iQIcBAABAgAGBQJSXDI9AAoJEEFjO5/oN/WB3dMP/iqmN5X09E+KsJNW3a/QVJdN FvYpXpGq27ODYpFw1q1U3TxOveWNSsIl+lcHLh3Og+FYYj7jNPuUiZGGn65MoVJ9 AwoTffwD4kGpAJh93G/Zxfx9mXmPP97ogFuWFQiHTQZvWXNCKxSQ6+gh0/fUEo15 vZW1C2NDhtww5W4rbmR01G4fTKS2Br6z3zYd8tRs8XksT2HMDSXs6fVYuLy2Ymqo bvoWYwRTkoIhYkAAGQwzpC5qtwByRzGumfci8kTnvIep6nRpf739i/uc8c7KJgFH rN+ZsxiMTlZiuRjsP8h0gFrXnHpGNR2bKPil8KabpeqU7Jn9Ko/lw6Djc09wjBzP dAfwiaAhsGONCeCO6U/xWkf8lcU1HhDZUlruaYTfbBSo8B9hAo/AL9VMJausxCOb oN+a7Nmrs55FryJos/39PssPuWbc/SRtzCKH3ctPpa7sQYT7uk5dfuWqPjTZOUoD aT7hpy5q/FvijpyT0ifHSEh2wU0HLNJxXsKev+lDP8tek4b73TYi7M9TMnCueqF8 GfJbFTbUWfeY0n0YKgqWD83Za+UrZtyh/5tRqce52e7Q60e0w5EebVgxmB24mNxS YTWBGp8MeFty1a4rFlRz44AvwNGwOqaMCPcEcoqSgPtpNLr2Xf9vHocHqkKR/QaI IoX6Dg/Oe+rUXF6P8hOG =9Ly/ -----END PGP SIGNATURE----- --nextPart172744395.y0HCXvDVWQ--