public inbox for ell@lists.linux.dev
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: NHO <jy6x2b32pie9@yahoo.com>, ell@lists.linux.dev
Subject: Re: Missing basename in util/test-path.c on musl-based systems
Date: Thu, 27 Feb 2025 07:02:05 -0800	[thread overview]
Message-ID: <68de70e9-336b-49ad-bcb9-a714cd37bb9f@gmail.com> (raw)
In-Reply-To: <647ff8e8-caa7-4b26-8780-1e8308e19e5b@yahoo.com>

Hi,

On 2/23/25 8:43 AM, NHO wrote:
> In systems using musl as libc, eg. certain Gentoo profiles, tests of 
> ell fail to build, with error:
> clang -DHAVE_CONFIG_H -I.    -fvisibility=hidden 
> -DUNITDIR=\""./unit/"\" -DCERTDIR=\""./unit/"\" -O2 -pipe 
> -fsigned-char -Wno-unknown-warning-option -Wno-unknown-pragmas -c -o 
> unit/test-path.o unit/test-path.c
> unit/test-path.c:65:9: error: call to undeclared function 'basename'; 
> ISO C99 and later do not support implicit function declarations 
> [-Wimplicit-function-declaration]
>    65 |         base = basename(tmp_path);
>       |                ^
> unit/test-path.c:65:9: note: did you mean 'l_basename'?
> ./ell/path.h:20:13: note: 'l_basename' declared here
>    20 | const char *l_basename(const char *path);
>       |             ^
> unit/test-path.c:65:7: error: incompatible integer to pointer 
> conversion assigning to 'char *' from 'int' [-Wint-conversion]
>    65 |         base = basename(tmp_path);
>       |              ^ ~~~~~~~~~~~~~~~~~~
> 2 errors generated.
>
> Musl doesn't have GNU basename() in the string.h, only POSIX in libgen.h
> See also: Gentoo bug https://bugs.gentoo.org/942788
> second error appears to be a false positive.
>
I just sent a patch updating this test to use ELL's internal 
implementation, l_basename(). This should fix the build on musl.

Thanks,

James


      reply	other threads:[~2025-02-27 15:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <647ff8e8-caa7-4b26-8780-1e8308e19e5b.ref@yahoo.com>
2025-02-23 16:43 ` Missing basename in util/test-path.c on musl-based systems NHO
2025-02-27 15:02   ` James Prestwood [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=68de70e9-336b-49ad-bcb9-a714cd37bb9f@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=ell@lists.linux.dev \
    --cc=jy6x2b32pie9@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox