From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1031 invoked by alias); 14 Oct 2013 17:59:23 -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 860 invoked by uid 89); 14 Oct 2013 17:59:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 4 recipients X-HELO: mail2-relais-roc.national.inria.fr Received: from mail2-relais-roc.national.inria.fr (HELO mail2-relais-roc.national.inria.fr) (192.134.164.83) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Mon, 14 Oct 2013 17:59:22 +0000 Received: from ip-173.net-81-220-32.lyon.rev.numericable.fr (HELO laptop-mg.local) ([81.220.32.173]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Oct 2013 19:59:16 +0200 Date: Mon, 14 Oct 2013 17:59:00 -0000 From: Marc Glisse To: sid@sourceware.org, newlib@sourceware.org, gdb-patches@sourceware.org, binutils@sourceware.org, gcc-patches@gcc.gnu.org Subject: [libiberty] xmalloc cannot return NULL Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-SW-Source: 2013-q4/txt/msg00001.txt.bz2 Hello, 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). 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. 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. http://gcc.gnu.org/ml/gcc-patches/2013-10/msg00817.html -- Marc Glisse