public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.aribaud@3adev.fr>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH v2 2/2] Y2038: make __tz_convert compatible with 64-bit-time
Date: Thu, 14 Jun 2018 17:52:00 -0000	[thread overview]
Message-ID: <20180614195149.60f6114d@athena> (raw)
In-Reply-To: <de6545e4-530a-8fa8-f980-d2d1b5d996bb@cs.ucla.edu>

Hi Paul,

On Thu, 14 Jun 2018 10:07:18 -0700, Paul Eggert <eggert@cs.ucla.edu>
wrote :

> On 06/14/2018 06:51 AM, Albert ARIBAUD (3ADEV) wrote:
> > +#if __TIMESIZE == 64
> > +# define __ctime64 ctime
> > +# define __ctime64_r ctime_r
> > +#endif
> > +
> > +#if __TIMESIZE == 64
> > +# define __localtime64 localtime
> > +#else
> > +extern struct tm *__localtime64 (const __time64_t *__timer);
> > +#endif  
> 
> These don't seem symmetric. Why don't we need an extern declaration for 
> __ctime_64 or for __ctime_64_r? If the code is correct, maybe a comment why?
 
The asymmetry (that ctime and ctime_r are only declared in time/time.h
whereas localtime, localtime_r, gmtime and gmtime_r are declared both in
include/time.h as well as time/time.h) existed before my patches, and I
do not know the reason.

I felt I should not add declarations for ctime / ctime_r in
include/time as obviously glibc builds fine without these, and my
patches are not about adding 32-bit declarations but about adding
64-bit support.

However, I can add them if requested.

> > +#if (__TIMESIZE != 64)  
> No parentheses here (and similarly elsewhere).

Fixed everywhere.

> +/* The C Standard says ctime (t) is equivalent to asctime (localtime (t)).
> +   In particular, ctime and asctime must yield the same pointer. */
> +  return asctime (__localtime64 (t));
> 
> Please indent the comment to be like what it was before.

Done.

> Otherwise looks good; thanks.

Thanks to you for the reviews!

Cordialement,
Albert ARIBAUD
3ADEV

  reply	other threads:[~2018-06-14 17:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-14 13:51 [PATCH v2 0/2] Y2038 support batch 1 - __time64_t and __tz_convert Albert ARIBAUD (3ADEV)
2018-06-14 13:51 ` [PATCH v2 1/2] Y2038: Add 64-bit time for all architectures Albert ARIBAUD (3ADEV)
2018-06-14 13:57   ` Joseph Myers
2018-06-14 18:51     ` Albert ARIBAUD
2018-06-14 16:56   ` Paul Eggert
2018-06-14 17:52     ` Albert ARIBAUD
2018-07-30  5:38   ` Ben Hutchings
2018-07-30  5:41     ` Ben Hutchings
2018-06-14 13:51 ` [PATCH v2 2/2] Y2038: make __tz_convert compatible with 64-bit-time Albert ARIBAUD (3ADEV)
2018-06-14 17:07   ` Paul Eggert
2018-06-14 17:52     ` Albert ARIBAUD [this message]
2018-06-14 18:52       ` Paul Eggert
2018-06-14 19:40         ` Joseph Myers
2018-06-16 14:03           ` Albert ARIBAUD
2018-06-16 14:23             ` Paul Eggert
2018-06-16 18:21               ` Albert ARIBAUD

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=20180614195149.60f6114d@athena \
    --to=albert.aribaud@3adev.fr \
    --cc=eggert@cs.ucla.edu \
    --cc=libc-alpha@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).