unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: Joseph Myers <joseph@codesourcery.com>, Paul Eggert <eggert@cs.ucla.edu>
Cc: <libc-alpha@sourceware.org>
Subject: Re: [PATCH v2 1/2] Y2038: make __mktime_internal compatible with __time64_t
Date: Sun, 17 Mar 2019 23:48:53 +0100	[thread overview]
Message-ID: <20190317234853.2d8cf98b@jawa> (raw)
In-Reply-To: <alpine.DEB.2.21.1903120033560.28233@digraph.polyomino.org.uk>

[-- Attachment #1: Type: text/plain, Size: 2669 bytes --]

Hi Joseph, Paul,

> On Mon, 11 Mar 2019, Paul Eggert wrote:
> 
> > On 2/27/19 3:20 AM, Lukasz Majewski wrote:  
> > > +/* Another name for `__mktime64'.  */
> > > +extern __time64_t __timelocal64 (struct tm *__tp) __THROW;  
> > 
> > In hindsight the name 'timelocal' was a mistake: it's not a portable
> > name and its use has not caught on. Although we need to keep
> > 'timelocal' for backwards compatibility, there's no need to define
> > 'timelocal64', as the very few people who need such a function can
> > just call mktime64. So I suggest removing all traces of
> > timelocal64, __timelocal64, etc. from the patch. 
> 
> Neither timelocal64 nor mktime64 will be a public API; the public API
> is to define _TIME_BITS=64 (and _FILE_OFFSET_BITS=64 because we don't
> want to support the combination of 64-bit times with 32-bit offsets)
> before including any system headers, then call the existing function
> names.

I do have a doubt if I understood the above comment(s). 

Please correct me if I'm wrong - this patch makes the
__mktime_internal compatible with __time_64 explicit 64 bit time data
structure.

It's goal is to replace all calls to mktime/timegm/localtime with
__mktime64/__timegm64/__localtime64 (alias to __mktime64) internal
counterparts (another level of abstraction with explicit 64 bit time
storage).

Then, the __mktime64() internal function is used to implement mktime
wrapper for 32-bit time (the same approach is for timegm).

This patch looks like a preparatory patch for further Y2038 conversion
(but doesn't provide one).

> 
> Given timelocal as part of the __USE_MISC API in time.h, it should be
> part of the __USE_MISC __TIME_BITS=64 API there as well - but it's

This patch doesn't introduce/use the _TIME_BITS=64 - instead it
operates on TIMESIZE=64.

> fine for that case to redirect to __mktime64 (and thus not need
> __timelocal64 as another alias).
> 


Do you require following code in include/time.h for timelocal:

#if defined __USE_MISC
# if defined(__REDIRECT)
  extern int __REDIRECT (timelocal, (struct tm *__tp),
                         __mktime64) __THROW);
# else
#  define timelocal __mktime64
# endif
#endif


The problem seems to be that Paul requested to remove {__}timelocal64
from this patch and you pointed out that timelocal is already supported
when __USE_MISC is defined?




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2019-03-17 22:49 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-27 11:20 [PATCH v2 1/2] Y2038: make __mktime_internal compatible with __time64_t Lukasz Majewski
2019-02-27 11:20 ` [PATCH v2 2/2] Fix time/mktime.c and time/gmtime.c for gnulib compatibility Lukasz Majewski
2019-03-12  0:12   ` Paul Eggert
2019-03-06 11:31 ` [PATCH v2 1/2] Y2038: make __mktime_internal compatible with __time64_t Lukasz Majewski
2019-03-12  0:11 ` Paul Eggert
2019-03-12  0:36   ` Joseph Myers
2019-03-17 22:48     ` Lukasz Majewski [this message]
2019-03-18 16:27       ` Joseph Myers
2019-03-19 10:53         ` Lukasz Majewski
2019-03-12  6:58   ` Lukasz Majewski
2019-03-18 21:23     ` Paul Eggert
2019-03-19 13:39       ` Lukasz Majewski
2019-03-19 23:12         ` Paul Eggert
2019-03-20  7:03           ` Lukasz Majewski
2019-03-22 21:49             ` Paul Eggert
2019-03-23 21:34               ` Lukasz Majewski
2019-03-24 22:17                 ` Lukasz Majewski
2019-03-23 11:59           ` Lukasz Majewski
2019-03-27 20:06             ` Paul Eggert
2019-03-28  8:59               ` Lukasz Majewski
2019-03-28 16:09                 ` Paul Eggert
2019-03-29 14:24                   ` Lukasz Majewski
2019-03-29 21:10                     ` Paul Eggert
2019-03-30 14:39                       ` Lukasz Majewski
2019-04-01 20:17                     ` Joseph Myers
2019-04-01 20:51                       ` Lukasz Majewski
2019-03-28 16:34                 ` Joseph Myers
     [not found]               ` <20190404120715.150a5d44@jawa>
     [not found]                 ` <20190424135748.502c34af@jawa>
2019-04-28 22:45                   ` Paul Eggert
2019-04-30  7:59                     ` Lukasz Majewski
2019-04-30 16:25                       ` Paul Eggert
2019-05-02  7:19                         ` Lukasz Majewski

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

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190317234853.2d8cf98b@jawa \
    --to=lukma@denx.de \
    --cc=eggert@cs.ucla.edu \
    --cc=joseph@codesourcery.com \
    --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).