From: Natanael Copa <ncopa@alpinelinux.org>
To: "Gary E. Miller" <gem@rellim.com>
Cc: musl@lists.openwall.com
Subject: Re: [musl] *strerror_r() bug in musl
Date: Wed, 13 Apr 2022 14:24:32 +0200 [thread overview]
Message-ID: <20220413142432.311e20f5@ncopa-desktop.lan> (raw)
In-Reply-To: <20220412134355.59bd920e@spidey.rellim.com>
On Tue, 12 Apr 2022 13:43:55 -0700
"Gary E. Miller" <gem@rellim.com> wrote:
> Yo All!
Hi!
>
> I'm new to the list. I;ve been trying to report a musl bug on #musl since
> last Friday, but no one seems to live there.
>
> musl (all versions) has a bug in strerror_r().
>
> The musl reference manual says of _GNUSOURCE:
>
> _GNU_SOURCE (or _ALL_SOURCE)
>
> Adds everything above, plus interfaces modeled after GNU libc
> extensions and interfaces for making use of Linux-specific features.
>
> I take that to mean that when _GNU_SOURCE is used to compile code with musl
> that the results will behave as GNU libc (glinc).
Well, as other has mentioned. GNU libc has a non-compliant version of
strerror_r.
...
> When _GNU_SOURCE is defined with glibc, then strerror_r() returns a char *.
I have met this in multiple places the last decade. The usual way to
fix it is to also check for GNU libc in addition to _GNU_SOURCE.
#if defined (__GLIBC__) && defined (_GNU_SOURCE)
/* non-standard GLIBC exception */
#else
/* standard behavior for everything else */
#endif
-nc
next prev parent reply other threads:[~2022-04-13 12:24 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-12 20:43 [musl] ✘strerror_r() " Gary E. Miller
2022-04-12 20:48 ` alice
2022-04-12 21:04 ` Gary E. Miller
2022-04-12 20:56 ` Alex Xu (Hello71)
2022-04-12 21:07 ` Gary E. Miller
2022-04-12 23:16 ` Wolf
2022-04-13 0:15 ` Gary E. Miller
2022-04-12 21:13 ` Gary E. Miller
2022-04-13 3:44 ` Rich Felker
2022-04-13 12:24 ` Natanael Copa [this message]
2022-04-13 14:05 ` [musl] *strerror_r() " Rich Felker
2022-04-13 17:36 ` Gary E. Miller
2022-04-13 20:38 ` Rich Felker
2022-04-13 21:16 ` Gary E. Miller
2022-04-13 22:27 ` Rich Felker
2022-04-13 22:43 ` Gary E. Miller
2022-04-13 22:58 ` Rich Felker
2022-04-13 23:07 ` Gary E. Miller
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=20220413142432.311e20f5@ncopa-desktop.lan \
--to=ncopa@alpinelinux.org \
--cc=gem@rellim.com \
--cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).