From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 100914 invoked by alias); 11 Sep 2017 06:33:06 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 99549 invoked by uid 89); 11 Sep 2017 06:33:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: zimbra.cs.ucla.edu Subject: Re: [RFC PATCH 51/52] Y2038: add RPC functions To: Albert ARIBAUD Cc: libc-alpha@sourceware.org References: <20170907224219.12483-50-albert.aribaud@3adev.fr> <20170908174909.28192-1-albert.aribaud@3adev.fr> <20170908174909.28192-2-albert.aribaud@3adev.fr> <20170909163728.05fa95ee.albert.aribaud@3adev.fr> From: Paul Eggert Message-ID: <30e0ad02-0717-88f7-b2d6-6a5c66b62892@cs.ucla.edu> Date: Mon, 11 Sep 2017 06:33:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170909163728.05fa95ee.albert.aribaud@3adev.fr> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-SW-Source: 2017-09/txt/msg00435.txt.bz2 Albert ARIBAUD wrote: > time_t is a signed int, but its negative range is not completely > usable since (time_t)-1 is used as an error status. So should the > TIME_T_MIN limit be LONG_MIN or should it be 0? Definitely LONG_MIN. Functions like localtime accept -1 as valid input mean= ing=20 1969-12-31 23:59:59 UTC. Even for some functions like mktime that return -1 as an error indicator, -= 1 can=20 also be a valid (non-error) return value. I help maintain application code = that=20 can tell the difference between the two seemingly-identical -1s that mktime= =20 returns, so that the time_t range is completely usable there too. Admittedl= y=20 it's not an ideal API.