This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH] Check for existence of asprintf and vasprintf
- From: Ulf Hermann <ulf dot hermann at qt dot io>
- To: elfutils-devel at sourceware dot org
- Date: Thu, 23 Feb 2017 10:39:14 +0100
- Subject: Re: [PATCH] Check for existence of asprintf and vasprintf
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=ulf dot hermann at qt dot io;
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qtcompany.onmicrosoft.com; s=selector1-qt-io; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=cDrCUVavnFCsBIyVJ444o5FXG2OMdG6bN7UmHrryxwk=; b=q0lgs2DZMpPLqQ+w18GEPOZg3sf0BxyCsYiKVa0ql+IS8IkxLyPpKKVqMN/fwQfBA9fv+TPLmPM+9iIR6fXA/3pBOF+CrOq6j6IxdiUW66+20yJ8jCkSRbbAiZtS4yOiM4YPVbRhtGM1XgVYONulUHGuocg0xc3cKSDeb9hhMl4=
- References: <4efb45a7-3035-67eb-d61e-62e795afd881@qt.io> <20170222144004.GV28432@vapier> <3716c28b-6478-ee4d-50cf-0ef43e8196f3@qt.io> <20170222163249.GW28432@vapier> <59040cc2-f681-7610-5115-9a7c6c94b6c9@qt.io> <20170222170356.GX28432@vapier> <84aaee58-674a-5b94-7047-f4770faff345@qt.io> <20170222185737.GE28432@vapier>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
> basename() is in the dirname module
That's the POSIX variant. We're using the GNU variant everywhere and the GNU variant is a whopping two lines of code:
char *base = strrchr(path, '/');
return base ? base + 1 : (char *)path;
> you're correct that GNU strerror_r is not handled by gnulib.
> that doesn't look like it's too hard to deal with, but it is
> something that'd have to be considered.
We're using strerror_r in exactly one place and my proposal is to just return a fixed string if we hit that on platforms where GNU strerror_r is not available.
Ulf