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 8F5A93858038 for ; Mon, 25 Jan 2021 21:32:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8F5A93858038 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 4DPjk81lDNz1qs0Z; Mon, 25 Jan 2021 22:31:59 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4DPjk764x3z1s8Tr; Mon, 25 Jan 2021 22:31:59 +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 MrfX9aGci4Ft; Mon, 25 Jan 2021 22:31:58 +0100 (CET) X-Auth-Info: GclRUNr1LPwwCnNczIw5uJIL/rSQ1k1E4m/8GfThXl4= Received: from jawa (89-64-25-12.dynamic.chello.pl [89.64.25.12]) (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, 25 Jan 2021 22:31:57 +0100 (CET) Date: Mon, 25 Jan 2021 22:31:50 +0100 From: Lukasz Majewski To: Joseph Myers Cc: Adhemerval Zanella , Florian Weimer , GNU C Library , Florian Weimer , Alistair Francis Subject: Re: [PATCH] tst: Provide Y2038 tests for mktime (tst-mktime4.c) Message-ID: <20210125223150.692ec27b@jawa> In-Reply-To: References: <20210125130308.32242-1-lukma@denx.de> Organization: denx.de X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/EsuV7dF7f/UfPcM97ufo6=l"; protocol="application/pgp-signature" X-Spam-Status: No, score=2.7 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_ABUSEAT, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: ** 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, 25 Jan 2021 21:32:03 -0000 --Sig_/EsuV7dF7f/UfPcM97ufo6=l Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Joseph, > On Mon, 25 Jan 2021, Lukasz Majewski wrote: >=20 > > + /* Check that mktime(1970-01-01 00:00:00) returns 0. */ > > + test_mktime_helper (&tm0, 0); > > + > > + /* Check that mktime(2038-01-19 03:14:07) returns 0x7FFFFFFF. */ > > + test_mktime_helper (&tmY2038, 0x7fffffff); > > + > > + /* Check that mktime(2038-01-19 03:14:08) returns 0x80000000 > > + (time_t overflow). */ > > + if (sizeof (time_t) > 4) > > + { > > + tmY2038.tm_sec++; > > + test_mktime_helper (&tmY2038, 0x80000000); > > + } > > + else > > + FAIL_UNSUPPORTED ("32-bit time_t"); =20 >=20 > FAIL_UNSUPPORTED causes the whole test to report an UNSUPPORTED > status. If a test has a mixture of assertions that work with 32-bit > time and assertions that only work for 64-bit time, I think those > should be split into separate tests so that those tests that make > sense with 32-bit time still produce results in that case. >=20 The idea behind this FAIL_UNSUPPORTED when sizeof(time_t) <=3D 4 is to: 1. On 32 bit ports - check correct operation of mktime for 32 bit time_t. If those checks fail, then we fail the test. Tests which require 64 bit size of time_t will not be supported until -D_TIME_BITS=3D64 is supported in glibc. 2. On 64 bit ports - the test will either end without errors or fail. 3. I do have corresponding test - tst-mktime4-y2038.c [1] which only has following lines: #define _TIME_BITS 64 #define _FILE_OFFSET_BITS 64 #include "tst-mktime4.c" Which will either pass or fail when 64 bit time_t support is added on ports with __WORDSIZE=3D32 && __TIMESIZE !=3D 64. However, there is no point to send tst-mktime4-y2038.c until the above feature is supported. Links: [1] - https://github.com/lmajewski/y2038_glibc/commits/y2038_edge 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_/EsuV7dF7f/UfPcM97ufo6=l Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAmAPOMYACgkQAR8vZIA0 zr0fKAgArOZU7QwWuFUQRo9cTcuYgh+uGSAzzOub9hgFzEuHF+4XU0rd0nkulIsT f0NWuu49o/Y6nw4BY26vbtUhGS2jzy2THaoC8wN46CM3/0dtpHWV/mIgWYRkoXVt 4+PdKOd7quWXlKab5NBSuuQf90Yef8YtP7SIePPzUCILy2pslfFw7hPMltFgeFcg 2l89Foc3ZUlQ/z5nijWnjaHI2wPrstpqYj1yG+AeMOPrMJh48q7/hHDC+QplYSYF 2rccYVMxJeWt4NtEkVJKH9r+hUBjPfbf54gIfMElSu3TXr/KAiMCGDwClp7kcXdF j4LePdu8B1gy7ENnwqhmM43c2azybA== =fs+z -----END PGP SIGNATURE----- --Sig_/EsuV7dF7f/UfPcM97ufo6=l--