Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: Clayton Craft <clayton@craftyguy.net>
To: Denis Kenzior <denkenz@gmail.com>
Cc: iwd@lists.linux.dev
Subject: Re: [PATCH] wiphy: include libgen.h to fix implicit def. with musl libc
Date: Tue, 13 Feb 2024 16:13:24 -0800	[thread overview]
Message-ID: <20240213161324.GB1034@craftyguy.net> (raw)
In-Reply-To: <8b02ff06-9c2b-4503-8fb8-9784c2628394@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1271 bytes --]

Hi Denis,

On Tue, 13 Feb 2024 17:09:19 -0600 Denis Kenzior <denkenz@gmail.com> wrote:
> Hmm, why did musl do that?  man 3 basename indicates that the libgen.h version 
> implementation is free to scratch in the input argument, while the string.h one 
> doesn't.

From what I can tell, they added it here[1] to appease apps expecting the GNU
libc string.h:basename, and removed it here[2] because C23 drops non-proto
declarations?
Also I think it's not POSIX C compliant, so maybe some of the motivation for
musl to drop it? I'm just speculating though...

1. https://git.musl-libc.org/cgit/musl/commit/?id=06aec8d7152dfb8360cb7ed9b3d7215ca0b0b500
2. https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7

> In this particular case it doesn't matter since driver_path is never used again. 
>   Still, the string.h version is much more intuitive.

Ahh ok I understand, thanks for explaining the differences.

> Maybe this should be re-implemented in missing.h or ell (say l_file_basename or 
> l_dir_basename) instead?

I'd defer to y'all on what the right path forward is here, since I'm really not
familiar with the code base here. I'd like to see this fixed somehow, so I'm
happy to try implementing something you recommend.

-Clayton

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-02-14  0:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-12 18:47 [PATCH] wiphy: include libgen.h to fix implicit def. with musl libc Clayton Craft
2024-02-13 23:09 ` Denis Kenzior
2024-02-14  0:13   ` Clayton Craft [this message]
2024-02-14  7:03   ` Marcel Holtmann
2024-02-14 16:26     ` Denis Kenzior
2024-02-14 16:30       ` Marcel Holtmann
2024-02-14 16:35         ` Denis Kenzior
2024-02-14 16:39           ` Marcel Holtmann
2024-02-14 16:46             ` Denis Kenzior
2024-02-14 16:52               ` Marcel Holtmann
2024-03-14 22:30                 ` Clayton Craft
2024-03-15 13:49                   ` Denis Kenzior
2024-03-15 22:09                     ` Clayton Craft

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=20240213161324.GB1034@craftyguy.net \
    --to=clayton@craftyguy.net \
    --cc=denkenz@gmail.com \
    --cc=iwd@lists.linux.dev \
    /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