This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: 2.29 freeze update: Last fortnight
15.01.2019 18:49 Paul Eggert <eggert@cs.ucla.edu> wrote:
>
> On 1/15/19 9:16 AM, Rafal Luzynski wrote:
> > https://sourceware.org/ml/libc-alpha/2019-01/msg00239.html
>
> I took a look at those. Some comments:
Thank you, Paul.
Tamuki Shoichi, please prepare a new version with these remarks
applied.
> [...]
> > For %Ey conversion specifier, the default action is now
> > to pad the number with zero to keep minimum 2 digits, similar to %y.
> >+ Also, the optional flag (either _ or -) can be used for %EY, so that
> >+ the internal %Ey is interpreted as if decorated with the appropriate
> >+ flag.
>
> Change to:
>
> For the %Ey conversion specifier, the default action is now to zero-pad
> the number to two digits, like %y. Also, the optional flag (either _ or
> -) now affects the formatted year, like %EY.
Shouldn't the flags be quoted, like "_" and "-"? Also, it seems to me that
a line starting with a plain minus sign does not look good.
> > static size_t __strftime_internal (CHAR_T *, size_t, const CHAR_T *,
> >- const struct tm *, bool *
> >+ const struct tm *, int *, bool *
> > ut_argument_spec
> > LOCALE_PARAM) __THROW;
>
> I also am puzzled as to why the new argument is int * rather than plain
> int. Why not make it plain int and simplify the rest of the code
> accordingly?
I guess this is a kind of optimization: if yr_spec is calculated in the
first pass (calculating the width of the output) then there is no need
to calculate it on the second pass. But I am not sure we want to
sacrifice the simplicity and nice design of the code.
Regards,
Rafal