From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id kNF8Et9J816HIQAA0tVLHw (envelope-from ) for ; Wed, 24 Jun 2020 12:41:03 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 0IJTDt9J817AQQAA1q6Kng (envelope-from ) for ; Wed, 24 Jun 2020 12:41:03 +0000 Received: from arlo.cworth.org (arlo.cworth.org [50.126.95.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B1E649404CF for ; Wed, 24 Jun 2020 12:41:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 863506DE0EB7; Wed, 24 Jun 2020 05:40:57 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZK2vWHSPe-XV; Wed, 24 Jun 2020 05:40:57 -0700 (PDT) Received: from arlo.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id 23F136DE0F19; Wed, 24 Jun 2020 05:40:55 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 621EA6DE0F19 for ; Wed, 24 Jun 2020 05:40:53 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VdgyBhpxVwDT for ; Wed, 24 Jun 2020 05:40:52 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTP id 05A906DE0EB7 for ; Wed, 24 Jun 2020 05:40:51 -0700 (PDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id 65D21613AF; Wed, 24 Jun 2020 08:40:51 -0400 (EDT) Received: (nullmailer pid 467960 invoked by uid 1000); Wed, 24 Jun 2020 12:40:49 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: Re: [PATCH] lib: avoid casting gint64 to time_t In-Reply-To: <20200624110429.178032-1-david@tethera.net> References: <87o8p9nvq2.fsf@tethera.net> <20200624110429.178032-1-david@tethera.net> Date: Wed, 24 Jun 2020 09:40:49 -0300 Message-ID: <87lfkcocvi.fsf@tethera.net> MIME-Version: 1.0 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: notmuch-bounces@notmuchmail.org Sender: "notmuch" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 50.126.95.6 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: -1.01 X-TUID: JtTkC6uS8/h1 David Bremner writes: > > This is not a complete fix, but at least the timestamp ends up > aparently correct in the database. It looks like there are still > wonky conversions on reading the large timestamp from the database. There is another cast that is harder to avoid: notmuch_message_get_date casts the output of Xapian::sortable_unserialise to time_t. Changing that would require an API/ABI change. There are apparently still architectures where time_t is 32bits (it seems like these machines with failing tests are among them). For 0.30 I suspect the best thing is to mark the tests broken on architectures with 32 bit time_t. For the future I'm not sure, but maybe we should avoid time_t completely. d