mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Quentin Rameau <quinq@fifth.space>
To: musl@lists.openwall.com
Subject: Re: [musl] Detect qsort_r() support with preprocessor
Date: Sat, 16 Apr 2022 20:42:13 +0200	[thread overview]
Message-ID: <20220416204213.39e4d0e1.quinq@fifth.space> (raw)
In-Reply-To: <94a82803-acf0-4fb7-158b-b13cae530f6c@ludocode.com>

Hi Nicholas,

> On 2022-04-16 10:16, Quentin Rameau wrote:
>  > Just as a note, qsort_r() has indeed been added to POSIX-next, so you'd
>  > only need to ask for _POSIX_C_SOURCE with a value of 20XXXX, when it's
>  > actually been released.  
> 
> Well that doesn't help me today. But even if it did, GCC and Clang don't define
> _POSIX_C_SOURCE automatically. Under glibc it's only defined under -std=gnu*,
> not -std=c*, and under musl (Alpine) it doesn't appear to be defined either
> way.

Indeed, that isn't something that the compiler should define for the
application, it's for the application to request it.

> Like I said, I don't control the compiler flags with which my users will
> compile my library.

You actually do, or at least should.
It's ok to have requirements about a software to work, usually
dependencies, but requiring a standard (as in POSIX) environment is
regular and totally legitimate.

If your users decide to break your application expectations, then they
must have good reasons for it and should deal with it.

> If I can reliably detect with the preprocessor whether the
> platform has a qsort_r() function

That is the point, you cannot in the way you're going at it (until
POSIX-next is released).

  reply	other threads:[~2022-04-16 18:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-16  8:13 Nicholas Fraser
2022-04-16 12:01 ` Markus Wichmann
2022-04-16 14:16   ` Quentin Rameau
2022-04-16 17:50     ` Nicholas Fraser
2022-04-16 18:42       ` Quentin Rameau [this message]
2022-04-16 23:59         ` Nicholas Fraser
2022-04-17  2:04       ` Rich Felker
2022-04-19  3:38         ` Nicholas Fraser
2022-04-19  6:59           ` Markus Wichmann
2022-04-19 23:10             ` Nicholas Fraser
2022-04-19 13:32           ` Rich Felker

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=20220416204213.39e4d0e1.quinq@fifth.space \
    --to=quinq@fifth.space \
    --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).