This is the mail archive of the
mailing list for the SID project.
[libiberty] xmalloc cannot return NULL
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: sid at sourceware dot org, newlib at sourceware dot org, gdb-patches at sourceware dot org, binutils at sourceware dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 14 Oct 2013 19:59:16 +0200 (CEST)
- Subject: [libiberty] xmalloc cannot return NULL
- Authentication-results: sourceware.org; auth=none
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
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.