mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Thorsten Glaser <tg@mirbsd.de>, musl@lists.openwall.com
Subject: Re: getpass() feature test macro
Date: Thu, 10 Jul 2025 12:40:21 -0400	[thread overview]
Message-ID: <20250710164021.GX1827@brightrain.aerifal.cx> (raw)
In-Reply-To: <20250710181353.1dd6cef8@windsurf>

On Thu, Jul 10, 2025 at 06:13:53PM +0200, Thomas Petazzoni wrote:
> On Thu, 10 Jul 2025 12:01:30 -0400
> Rich Felker <dalias@libc.org> wrote:
> 
> > It's called _DEFAULT_SOURCE because it's what's exposed by default
> > (defined by default) if no more restrictive FTMs were already defined.
> 
> But they are defining _XOPEN_SOURCE because they use strptime(), which
> requires _XOPEN_SOURCE.

It only "requires _XOPEN_SOURCE" if you're writing code that defines
_POSIX_SOURCE or (via -std=...) __STRICT_ANSI__ such that you're
starting with a very strict namespace that doesn't expose anything
outside of it.

There are two options here. Either:

1. You stick to strictly following the standards, and not using things
   outside them, and declare that intention with one or more of the
   standards-specified feature test macros, or

2. You write to "whatever your platform has by default or as
   extensions", leaving the standard FTMs undefined or also defining
   the appropriate extension FTMs to get whatever extensions you want.

What this program seems to be doing is requesting a strict standards
environment and then expecting to be able to use something that's not
part of the standard.

So either drop _XOPEN_SOURCE, drop use of getpass, or add explicit
_BSD_SOURCE or _DEFAULT_SOURCE to get some extensions.

Rich


  reply	other threads:[~2025-07-10 16:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-09 21:52 [musl] getpass() feature test macro Thomas Petazzoni
2025-07-09 22:20 ` Thorsten Glaser
2025-07-09 23:56   ` [musl] " Rich Felker
2025-07-10  7:55     ` Thomas Petazzoni
2025-07-10 15:54       ` Rich Felker
2025-07-10 15:56         ` Thomas Petazzoni
2025-07-10 16:01           ` Rich Felker
2025-07-10 16:13             ` Thomas Petazzoni
2025-07-10 16:40               ` Rich Felker [this message]
2025-07-11 19:16               ` Thorsten Glaser
2025-07-11  0:46     ` [musl] " Haelwenn (lanodan) Monnier
2025-07-11  0:58       ` Haelwenn (lanodan) Monnier
2025-07-11  1:18         ` A. Wilcox

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=20250710164021.GX1827@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    --cc=tg@mirbsd.de \
    --cc=thomas.petazzoni@bootlin.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).