[PATCH] Check for existence of asprintf and vasprintf

Mike Frysinger vapier@gentoo.org
Wed Feb 22 17:04:00 GMT 2017


On 22 Feb 2017 17:45, Ulf Hermann wrote:
> > imo, elfutils shouldn't be growing these fallback implementations itself.
> > if you want to do this stuff, use gnulib instead.
> > 
> > then there is no ifdef hell in the source files, and you don't have to
> > worry about testing whether the ifdef's are correct because gnulib did
> > it all for you.
> 
> OK, so I won't post any more patches with replacement functions. I don't like the idea of using gnulib because the gnulib implementations are generally more complex and in order to maintain them I would have to track gnulib in addition to elfutils.

sorry, but i don't know what you're talking about.  you don't read the
gnulib code/modules directly, you just run gnulib-tool and tell it which
modules to import.  it does all the rest for you.

you want asprintf ?  then add it to the list.
modules=(
	asprintf
	glob
	vasprintf
	...whatever else you want...
)
gnulib-tool --import "${modules[@]}"

stick that in an autogen.sh script.

> Also I would have to review the licenses for each import. This is not something I'm excited to do for a few 3-line functions. But OK, I will consider it.

gnulib-tool has a --lgpl=[...] flag so you can automatically abort if
the desired license compatibility level isn't met.  so you don't have
to directly review every module if it isn't aborting.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/elfutils-devel/attachments/20170222/1d2d4274/attachment.sig>


More information about the Elfutils-devel mailing list