[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
xmalloc calling undeclared xalloc_die function
From: |
Florian Weimer |
Subject: |
xmalloc calling undeclared xalloc_die function |
Date: |
Fri, 09 Dec 2022 12:49:31 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
lib/xmalloc.c contains this function definition, unconditionally:
static void * _GL_ATTRIBUTE_PURE
nonnull (void *p)
{
if (!p)
xalloc_die ();
return p;
}
But the declaration of xalloc_die in lib/xalloc.h is conditional:
#if GNULIB_XALLOC_DIE
/* This function is always triggered when memory is exhausted.
It must be defined by the application, either explicitly
or by using gnulib's xalloc-die module. This is the
function to call when one wants the program to die because of a
memory allocation failure. */
/*extern*/ _Noreturn void xalloc_die (void);
#endif /* GNULIB_XALLOC_DIE */
I have a package (lbzip2 <https://github.com/kjn/lbzip2/>) which
supplies its own definition of xalloc_die, and fails to build due to an
undeclared function. So I'm wondering how this is supposed to work.
Thanks,
Florian
- xmalloc calling undeclared xalloc_die function,
Florian Weimer <=