public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Zack Weinberg <zackw@panix.com>
To: Albert ARIBAUD <albert.aribaud@3adev.fr>
Cc: Paul Eggert <eggert@cs.ucla.edu>,
	GNU C Library <libc-alpha@sourceware.org>,
	 Gnulib bugs <bug-gnulib@gnu.org>
Subject: Re: [PATCH 1/1] Y2038: add function __difftime64
Date: Thu, 05 Jul 2018 19:13:00 -0000	[thread overview]
Message-ID: <CAKCAbMgDUuHzLKcLoV4siZURdsQsecNgUu50fi_JLBvo++xtcQ@mail.gmail.com> (raw)
In-Reply-To: <20180705203637.66ae4947@athena>

On Thu, Jul 5, 2018 at 2:36 PM, Albert ARIBAUD <albert.aribaud@3adev.fr> wrote:
> I have had a look at gnulib in the meantime, and I would like to know
> if the following assumptions are correct:

I can't comment on anything else at all, but:

> - gnulib does not contain any module which provides the time_t type, but
>   some of gnulib's modules assume there is such a type, and it might be
>   wider than 32 bits.
>
> - gnulib does not provide difftime either, so ATM a difftime patch
>   would only make sense in glibc, not gnulib.

<time.h> has always been required to declare a type named time_t and a
function named difftime, ever since the original C standard in 1989.
So it makes sense for gnulib not to provide either, and to assume they
exist.

In the original C standard time_t is only required to be "an
arithmetic type capable of representing times".  That means it could
be any size of integer or floating-point.   This has not changed as of
C11 -- the term "arithmetic type" changed to "real type" because of
the addition of complex numbers, but that's all.  POSIX adds the
additional guarantee that time_t is an integer type, but still says
nothing about how wide it is.

zw

  reply	other threads:[~2018-07-05 19:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-20 12:14 [PATCH 0/1] Y2038 support batch 3 - difftime Albert ARIBAUD (3ADEV)
2018-06-20 12:14 ` [PATCH 1/1] Y2038: add function __difftime64 Albert ARIBAUD (3ADEV)
2018-06-20 19:29   ` Paul Eggert
2018-06-20 20:55     ` Albert ARIBAUD
2018-06-21 21:17       ` Paul Eggert
2018-06-25 22:32         ` Albert ARIBAUD
2018-06-25 23:56           ` Paul Eggert
2018-06-27 11:03             ` Albert ARIBAUD
2018-07-05 18:36               ` Albert ARIBAUD
2018-07-05 19:13                 ` Zack Weinberg [this message]
2018-07-05 19:40                 ` Paul Eggert
2018-07-05 20:38                   ` Albert ARIBAUD
2018-07-05 21:17                     ` Bruno Haible
2018-07-06  5:06                       ` Albert ARIBAUD
2018-07-06 22:54                         ` Paul Eggert
2018-07-06 22:40                       ` Paul Eggert
2018-07-06 22:37                     ` Paul Eggert
2018-07-17 20:40                   ` Joseph Myers
2018-07-05 20:50                 ` time_t in gnulib Bruno Haible

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=CAKCAbMgDUuHzLKcLoV4siZURdsQsecNgUu50fi_JLBvo++xtcQ@mail.gmail.com \
    --to=zackw@panix.com \
    --cc=albert.aribaud@3adev.fr \
    --cc=bug-gnulib@gnu.org \
    --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).