public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: newlib@sourceware.org
Subject: Re: Fw: [PATCH 1/2] strftime.c(__strftime): add %i, %q, %v, tests; tweak %Z docs
Date: Mon, 19 Sep 2022 17:21:35 -0600	[thread overview]
Message-ID: <311b666f-d1f2-7f1a-b31c-7131dd533feb@SystematicSw.ab.ca> (raw)
In-Reply-To: <CANk6obSE2DshJD2ZDwxQodFhjmdqKQG9Q0MaCiSEC9ho4Nt31A@mail.gmail.com>

On 2022-09-19 09:51, C Howland wrote:
>     newlib/libc/time/strftime.c(__strftime):
>     %i year in century [00..99] Synonym for "%y". Non-POSIX extension.
>     [tm_year]
>     %q GNU quarter of the year (from `<<1>>' to `<<4>>') [tm_mon]
>     %v OSX/Ruby VMS/Oracle date "%d-%b-%Y". Non-POSIX extension.
>     [tm_mday, tm_mon, tm_year]
>     add %i %q %v tests
>     %Z clarify current time zone *abbreviation* not "name" [tm_isdst]

> While the additions themselves nominally look good, all being extensions 
> they ought to be gated by the appropriate ifdefs, and the manual would 
> best mention what gates are needed to get them.  %q would be 
> __GNU_VISIBLE as the gate and _GNU_SOURCE for the user/manual, and I'd 
> guess probably __MISC_VISIBLE gate for the others (user action as noted 
> in sys/features.h).

Those features are more appropriate for application build time feature 
support selection, not for library implementations.

I checked and implementations (including BSD, and Cygwin strptime.cc) 
don't gate features, except by what the build config supports and desires:

	__CYGWIN__, __HAVE_LOCALE_INFO_EXTENDED__, __TM_GMTOFF,
	__TM_ZONE, _WANT_C99_TIME_FORMATS, MAKE_WCSFTIME, YEAR_BASE

and strptime.c *#defines _GNU_SOURCE* before all #include-s.

The overhead of the additions is minimal compared to existing 
conversions, the likely impact of issues with new conversions used in 
existing sources is low, and any use is defined as UB.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]

  parent reply	other threads:[~2022-09-19 23:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-17  5:00 [PATCH 0/2] strftime.c, strptime.c: " Brian Inglis
2022-09-17  5:00 ` [PATCH 1/2] strftime.c(__strftime): " Brian Inglis
     [not found]   ` <BN2P110MB15443B0E0009D450989B3ECF9A4D9@BN2P110MB1544.NAMP110.PROD.OUTLOOK.COM>
     [not found]     ` <CANk6obSE2DshJD2ZDwxQodFhjmdqKQG9Q0MaCiSEC9ho4Nt31A@mail.gmail.com>
2022-09-19 23:21       ` Brian Inglis [this message]
2022-10-18 14:03       ` Fw: " Corinna Vinschen
2022-10-20 22:07         ` Brian Inglis
2022-10-21 12:12           ` Corinna Vinschen
2022-10-21 20:43             ` Brian Inglis
2022-09-17  5:00 ` [PATCH 2/2] strptime.c(strptime_l): add %i, %q, %v Brian Inglis

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=311b666f-d1f2-7f1a-b31c-7131dd533feb@SystematicSw.ab.ca \
    --to=brian.inglis@systematicsw.ab.ca \
    --cc=newlib@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).