bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: xalloc.h drags in dependencies


From: Jim Meyering
Subject: Re: xalloc.h drags in dependencies
Date: Sat, 14 Nov 2009 16:12:00 +0100

Eric Blake wrote:
> I was surprised when I got a link failure when using the Solaris cc on
> test-chown.c due to missing program_name, even though using gcc did just
> fine.  It turns out that mgetgroups.c uses xalloc_oversized from
> "xalloc.h", which is only a macro and by itself drags nothing in; but the
> rest of xalloc.h includes four inline functions which in turn drag in
> references to xalloc_die, error, program_name, and thus the link failure.
>
> I thought about changing the #if HAVE_INLINE part of xalloc.h to instead
> be #if HAVE_INLINE && defined __GNUC__, but this penalizes other
> compilers.  I don't want to just open-code xalloc_oversized into
> mgetgroups.c.  So my idea was to move the one portion of xalloc.h that
> does not depend on xalloc_die into a header that is already LGPL; that
> way, mgetgroups would depend only on xsize, not xalloc.  So, how does this
> patch look?
...
> Subject: [PATCH 1/2] xalloc: move xalloc_oversized to xsize
>
> xalloc_oversized was the only thing in xalloc.h that did not
> depend on xalloc_die.  But due to inline functions in xalloc.h,
> Solaris cc gives a link failure if you use only xalloc_oversized
> and don't provide xalloc_die.  Moving it to the LGPL header
> xsize.h can allow other modules to break the link dependency.
>
> * modules/xalloc (Depends-on): Add xsize.
> * lib/xalloc.h (xalloc_oversized): Move...
> * lib/xsize.h: ...here.

Sorry, but if you really want to move it, I'd much prefer to
have it go to a completely new header file, than to require
that people include xsize.h (with which I have a fundamental
difference of opinion).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]