From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by sourceware.org (Postfix) with ESMTPS id 5CF703861800 for ; Mon, 7 Dec 2020 13:01:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5CF703861800 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=lukma@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4CqNjh4PqHz1qsZy; Mon, 7 Dec 2020 14:01:28 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4CqNjh323Kz1qwTL; Mon, 7 Dec 2020 14:01:28 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id BhZa1FTnCBSl; Mon, 7 Dec 2020 14:01:25 +0100 (CET) X-Auth-Info: /gqYk546rLX8Vff6TeIOGR41NbofTl127RWbkKoLCWg= Received: from jawa (89-64-5-98.dynamic.chello.pl [89.64.5.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Mon, 7 Dec 2020 14:01:25 +0100 (CET) Date: Mon, 7 Dec 2020 14:00:55 +0100 From: Lukasz Majewski To: Joseph Myers Cc: Paul Eggert , Adhemerval Zanella , Florian Weimer , GNU C Library , Siddhesh Poyarekar , Andreas Schwab , Stepan Golosunov , Alistair Francis Subject: Re: [RFC 1/6] y2038: Introduce _TIME_BITS flag to support 64 bit time on 32 bit systems Message-ID: <20201207140055.47c967ea@jawa> In-Reply-To: References: <20201204233604.7430-1-lukma@denx.de> <20201204233604.7430-2-lukma@denx.de> Organization: denx.de X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/LAIYsAy.=NGu5r5sVxf3Lmk"; protocol="application/pgp-signature" X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2020 13:01:33 -0000 --Sig_/LAIYsAy.=NGu5r5sVxf3Lmk Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Joseph, > On Sat, 5 Dec 2020, Lukasz Majewski wrote: >=20 > > This change introduces new compile time, supported by glibc flag - > > namely _TIME_BITS, which then is responsible for exporting > > __USE_TIME_BITS64 only =20 >=20 > As a major new user-visible feature, this needs to be mentioned in > NEWS. Ok. >=20 > > +/* We need to know the word size in order to check the time size. > > */ +#include > > + > > +#if defined _TIME_BITS > > +# if _TIME_BITS =3D=3D 64 > > +# if ! defined (_FILE_OFFSET_BITS) || _FILE_OFFSET_BITS !=3D 64 > > +# error _TIME_BITS=3D=3D64 is allowed only when _FILE_OFFSET_BITS=3D= =3D64 > > +# elif __WORDSIZE =3D=3D 32 > > +# define __USE_TIME_BITS64 1 > > +# endif =20 >=20 > __WORDSIZE isn't the right thing to check. On ARC or RV32 or x32,=20 > _TIME_BITS =3D=3D 64 should be a no-op, because time_t has always been > 64-bit for those glibc ports. That is, you should be checking > __TIMESIZE, not __WORDSIZE. Ok. Thanks for pointing this out >=20 > > +# elif _TIME_BITS =3D=3D 32 > > +# if __WORDSIZE > 32 > > +# error _TIME_BITS=3D32 is not compatible with __WORDSIZE > 32 =20 >=20 > Likewise, __TIMESIZE should be checked here, not __WORDSIZE. >=20 Ok. > > +@defvr Macro _TIME_BITS > > +This macro determines the bit size of @code{time_t} (and therefore > > the +bit size of all @code{time_t} derived types and the prototypes > > of all +related functions). If @code{_TIME_BITS} is undefined, the > > bit size of +time_t equals the bit size of the architecture. =20 >=20 > Apart from "bit size of the architecture" not being well-defined, > that's not right for ARC or RV32, 32-bit architectures with 64-bit > time_t. >=20 > Note there should be two spaces after "." in Texinfo manuals. >=20 > > +If @code{_TIME_BITS} is undefined, or if @code{_TIME_BITS} is > > defined +to the value @code{32} and @code{__WORDSIZE} is defined to > > the value +@code{32}, or or if @code{_TIME_BITS} is defined to the > > value @code{64} +and @code{__WORDSIZE} is defined to the value > > @code{64}, nothing changes. =20 >=20 > __WORDSIZE (and __TIMESIZE after the fix above) is not a user-visible=20 > interface, it's a glibc header implementation detail. The manual > (other than maint.texi) should not mention either such internal > macro; you need to talk about a concept of word size / default time_t > size that's explained purely in user-level interfaces, not glibc > internal macros. >=20 > > +If @code{_TIME_BITS} is defined to the value @code{64} and if > > +@code{__WORDSIZE} is defined to the value @code{32}, then the > > @w{64 bit} +time API and implementation are used even though the > > architecture word +size is @code{32}. Also, if the kernel provides > > @w{64 bit} time support, +it is used; otherwise, the @w{32 bit} > > kernel time support is used (with +no provision to address kernel > > Y2038 shortcomings). =20 >=20 > Use "32-bit" and "64-bit" (with hyphen) as adjectives. >=20 Thanks for pointing this out - I will rewrite the manual entry. 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 --Sig_/LAIYsAy.=NGu5r5sVxf3Lmk Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAl/OJ4cACgkQAR8vZIA0 zr0cywgA0NUQ1t1eyfwOYSklQA1QlFQG+kpcDz0s0rQDMJZb7akkNQi/dT28ZYxa ss853XC1gcXib76yayU3CNeI5U4cqVjwZQaJgeE4efWvHNCF16CRVYl5PRUtqnOb hU86cRtVoAU/NR6B0z7lesJS7RmErx/mXCIM8pGsFi7HJQunciclk+uEhix7z8dt t5X39Yde7OAx/Zn+BpFDSk2HyJiWKjl0r82IPfH/ppcIG3koNEBs7Z/kyILFnLPr ZPq2Lo3X5a+8kRVEq2eRqvh5JNjCtv7Fu1V9ERI+yFzAcF0KJQ6lp1TKdpNrT32Y E32oCQUZpb1kngvTFBRIQdbyV4O2/g== =komn -----END PGP SIGNATURE----- --Sig_/LAIYsAy.=NGu5r5sVxf3Lmk--