* [PATCH] <time.h>: Make strptime available by default
@ 2022-11-28 13:17 Florian Weimer
2022-11-28 13:55 ` Andreas Schwab
0 siblings, 1 reply; 4+ messages in thread
From: Florian Weimer @ 2022-11-28 13:17 UTC (permalink / raw)
To: libc-alpha
This matches what FreeBSD does.
---
time/time.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/time/time.h b/time/time.h
index d18089116e..f507b44228 100644
--- a/time/time.h
+++ b/time/time.h
@@ -101,7 +101,7 @@ extern size_t strftime (char *__restrict __s, size_t __maxsize,
const char *__restrict __format,
const struct tm *__restrict __tp) __THROW;
-#ifdef __USE_XOPEN
+#if (defined __USE_XOPEN || defined __USE_MISC)
/* Parse S according to FORMAT and store binary time information in TP.
The return value is a pointer to the first unparsed character in S. */
extern char *strptime (const char *__restrict __s,
base-commit: f704192911c6c7b65a54beab3ab369fca7609a5d
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] <time.h>: Make strptime available by default
2022-11-28 13:17 [PATCH] <time.h>: Make strptime available by default Florian Weimer
@ 2022-11-28 13:55 ` Andreas Schwab
2022-11-28 14:52 ` Florian Weimer
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2022-11-28 13:55 UTC (permalink / raw)
To: Florian Weimer via Libc-alpha; +Cc: Florian Weimer
On Nov 28 2022, Florian Weimer via Libc-alpha wrote:
> This matches what FreeBSD does.
Does it? What I see is that the strptime declaration is conditional on
__XSI_VISIBLE, which is their equivalent of __USE_XOPEN, I think.
> diff --git a/time/time.h b/time/time.h
> index d18089116e..f507b44228 100644
> --- a/time/time.h
> +++ b/time/time.h
> @@ -101,7 +101,7 @@ extern size_t strftime (char *__restrict __s, size_t __maxsize,
> const char *__restrict __format,
> const struct tm *__restrict __tp) __THROW;
>
> -#ifdef __USE_XOPEN
> +#if (defined __USE_XOPEN || defined __USE_MISC)
No need for parens.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] <time.h>: Make strptime available by default
2022-11-28 13:55 ` Andreas Schwab
@ 2022-11-28 14:52 ` Florian Weimer
2022-11-28 15:37 ` Andreas Schwab
0 siblings, 1 reply; 4+ messages in thread
From: Florian Weimer @ 2022-11-28 14:52 UTC (permalink / raw)
To: Andreas Schwab; +Cc: Florian Weimer via Libc-alpha
* Andreas Schwab:
> On Nov 28 2022, Florian Weimer via Libc-alpha wrote:
>
>> This matches what FreeBSD does.
>
> Does it? What I see is that the strptime declaration is conditional on
> __XSI_VISIBLE, which is their equivalent of __USE_XOPEN, I think.
Clang without any special flags defines __XSI_VISBLE to 700 on FreeBSD
13.1 at least, which is why the declaration is visible by default.
I'm not sure why we don't default to __USE_XOPEN. Maybe it has
something to do with our diverging definitions of strerror_r and
basename?
Thanks,
Florian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] <time.h>: Make strptime available by default
2022-11-28 14:52 ` Florian Weimer
@ 2022-11-28 15:37 ` Andreas Schwab
0 siblings, 0 replies; 4+ messages in thread
From: Andreas Schwab @ 2022-11-28 15:37 UTC (permalink / raw)
To: Florian Weimer; +Cc: Florian Weimer via Libc-alpha
On Nov 28 2022, Florian Weimer wrote:
> * Andreas Schwab:
>
>> On Nov 28 2022, Florian Weimer via Libc-alpha wrote:
>>
>>> This matches what FreeBSD does.
>>
>> Does it? What I see is that the strptime declaration is conditional on
>> __XSI_VISIBLE, which is their equivalent of __USE_XOPEN, I think.
>
> Clang without any special flags defines __XSI_VISBLE to 700 on FreeBSD
> 13.1 at least, which is why the declaration is visible by default.
<sys/cdefs.h> defines this by default:
#else /* Default environment: show everything. */
#define __POSIX_VISIBLE 200809
#define __XSI_VISIBLE 700
#define __BSD_VISIBLE 1
#define __ISO_C_VISIBLE 2011
#define __EXT1_VISIBLE 1
#endif
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-11-28 15:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-28 13:17 [PATCH] <time.h>: Make strptime available by default Florian Weimer
2022-11-28 13:55 ` Andreas Schwab
2022-11-28 14:52 ` Florian Weimer
2022-11-28 15:37 ` Andreas Schwab
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 read-only IMAP folder(s) and NNTP newsgroup(s).