public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Rafal Luzynski <digitalfreak@lingonborough.com>
To: libc-alpha <libc-alpha@sourceware.org>,
	 Florian Weimer <fweimer@redhat.com>,
	 Rical Jasan <ricaljasan@pacific.net>
Subject: Re: [RFC][PATCH v4 06/11] Provide backward compatibility for strftime family (bug 10871).
Date: Thu, 17 Nov 2016 11:18:00 -0000	[thread overview]
Message-ID: <956759494.402156.1479381508919@poczta.nazwa.pl> (raw)
In-Reply-To: <703fb2bf-bf30-841d-3bd9-23c32364edb5@pacific.net>

Thank you for your reply, Rical.  I hope it moves us forward.

Please see more comments below:

16.11.2016 14:05 Rical Jasan <ricaljasan@pacific.net> wrote:
> [...]
> As I understand it:
>
> 1. the standard doesn't say %B/MON_ should be genitive or nominative
> 2. the standard does say UB for %O'x', x not in the list
> 3. the current glibc %B/MON_ returns nominative
> 4. the BSD/POSIX (proposed) %OB/ALTMON_ returns nominative

That's true as long as you remember that "nominative" is actually
a shortcut for "a form appropriate when formatting a month name
standalone, without a day number" and "genitive" is actually
a shortcut for "a form appropriate when formatting a month name
in a full date context, with a day number".  As Florian correctly
pointed out in some languages (German, also English) a correct form
when formatting a full date is nominative.  These languages should
not be forced to use genitive if their rules say not to use
genitive in that context.

> So your patch is changing the behaviour of the format specifier %B in a
> way allowable by the standard, and it adds a non-standard extension %OB
> which the standard explicitly states is undefined, but not disallowed.
> Additionally, binaries built against pre-%OB glibc running on post-%OB
> glibc will still have the old behaviour.

True, backward compatibility for existing binaries is retained.
There are of course concerns about existing sources which are
recompiled without any change but as I noted before:

1. If they are open source project we can reach them out and
   help them adopt.
2. The cases where the change will be actually needed are probably
   rare compared with the cases where a new behaviour of %B will
   finally generate a correct form without any work on their side.

> I'm fine what that; I had a different version of this in my mind (see
> below). Thank you for prompting me to give this more thought. You are
> definitely between a rock and hard place. :)
>
> I think I should respond to Florian's objection [5] at this point.
>
> Florian,
>
> Were you opposed to the work of trying to make %B a little smarter? It
> looks like Rafal abandoned that approach voluntarily, and opted to chase
> the unification on the horizon when it was pointed out BSD and the POSIX
> proposal were actually the same. [6]
> [...]

When you refer to my earlier smart (heuristic) implementation of %B do
you mean my attempt to implement an algorithm detecting if %B is in
a context of full date (near a day number) or not?  Except realizing
that BSD and the POSIX proposal are actually the same there is another
argument against the smart algorithm.  I think that I saw an implementation
in a date utility which scans the format string and then calls strftime()
for each format specifier separately.  This way a smart implementation
would have no way to tell if %B is just after a day number (well, it could
maintain some internal state) and definitely no way to tell if the next
call after a current %B will also contain a day number.

Here I preserve your links:

>
> [1]
> http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap07.html#tag_07_03_05
> [2] http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html
> [3] https://sourceware.org/bugzilla/show_bug.cgi?id=10871
> [4] http://austingroupbugs.net/view.php?id=258
> [5] https://sourceware.org/ml/libc-alpha/2016-11/msg00322.html
> [6] https://sourceware.org/bugzilla/show_bug.cgi?id=10871#c40

Regards,

Rafal

  reply	other threads:[~2016-11-17 11:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-28  0:49 Rafal Luzynski
2016-11-04 13:40 ` Florian Weimer
2016-11-05 10:53   ` Rafal Luzynski
2016-11-07 14:13     ` Florian Weimer
2016-11-08 11:39       ` Rafal Luzynski
2016-11-09 10:49         ` Florian Weimer
2016-11-10  0:33           ` Rafal Luzynski
2016-11-10 12:41             ` Florian Weimer
2016-11-10 18:42               ` Rafal Luzynski
2016-11-10 19:19                 ` Andreas Schwab
2016-11-15  1:21                   ` Rafal Luzynski
2016-11-11  3:52             ` Rical Jasan
2016-11-15  1:38               ` Rafal Luzynski
2016-11-15 11:09                 ` Rafal Luzynski
2016-11-16 13:06                 ` Rical Jasan
2016-11-17 11:18                   ` Rafal Luzynski [this message]
2016-11-18  9:22                     ` Rical Jasan
2016-11-22 23:56                       ` Rafal Luzynski
2016-11-09 11:00       ` Florian Weimer

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=956759494.402156.1479381508919@poczta.nazwa.pl \
    --to=digitalfreak@lingonborough.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=ricaljasan@pacific.net \
    /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).