From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id CD+fKLmr8144TwAA0tVLHw (envelope-from ) for ; Wed, 24 Jun 2020 19:38:33 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 0DiCJLmr8168aAAAB5/wlQ (envelope-from ) for ; Wed, 24 Jun 2020 19:38:33 +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 3C84C9400C1 for ; Wed, 24 Jun 2020 19:38:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 5C3E16DE142B; Wed, 24 Jun 2020 12:38:28 -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 VKsHaGfPsmlg; Wed, 24 Jun 2020 12:38:27 -0700 (PDT) Received: from arlo.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id 96FFD6DE1430; Wed, 24 Jun 2020 12:38:26 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id CE4F76DE1430 for ; Wed, 24 Jun 2020 12:38:24 -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 8y0FZ9LAqbB6 for ; Wed, 24 Jun 2020 12:38:22 -0700 (PDT) Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) by arlo.cworth.org (Postfix) with ESMTPS id 81B416DE142B for ; Wed, 24 Jun 2020 12:38:20 -0700 (PDT) Received: from guru.guru-group.fi (unknown [IPv6:2a02:2380:1:9:5054:ff:feb7:a4bc]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: too) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id DE56A1B0009B; Wed, 24 Jun 2020 22:38:16 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1593027496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9XTNyURZSOkJ4aSW9ViCbn6cIma2v808NTMEf87ZUek=; b=vaTT1haT6IFAYA2COmqJNh4sdOnPvDcphEdwDuHt3ji1/z287nKezmb7gT64g07PeyyGGF VUB4eNRsqnBPr8rlMNZR/SDr3kX4X+rW2AvDuVX/KgySNuOOa13+X1zAA7dsBrobsH23RO gaVu5PxTtG/dhPkms85ZBFHUuH4SdvFADlsB3PyC/H3oDWyuOcH3z/Ll9o+5E8/u4AwHGn nD2s0Q4LNxVA9Io2xy38BcUamkSnFfcU+hcFuJxKBgZFkxXWe9U+0wSbgoLZb+J4bd+P0W hstNx5YGCP+ATDmVha9UGyjQc+25EMfyLlSiWYVd6j/HJWqmAaU+oz2rVF1v0Q== From: Tomi Ollila To: David Bremner , notmuch@notmuchmail.org Subject: Re: [PATCH 1/2] configure: detect 64 bit time_t In-Reply-To: <20200624143234.540526-1-david@tethera.net> References: <87lfkcocvi.fsf@tethera.net> <20200624143234.540526-1-david@tethera.net> User-Agent: Notmuch/0.28.3+84~g41389bb (https://notmuchmail.org) Emacs/26.3 (x86_64-pc-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1593027496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9XTNyURZSOkJ4aSW9ViCbn6cIma2v808NTMEf87ZUek=; b=RO31A2YkKZan6bEeDxC/EIiVLUtHVFCiMsNOLbqbzkf7GTU949w70X4Sp3+CWWMI1cLac+ yM0TzRGZzXy3Jq2moO+667ll0/7uXW8pVDYoeUgIvIiHUyNcEsrq1pl0cElCrcwjvT+Fm9 r9ayDQoJY+hCAbPDG+S6ruLMhovb8JkSKvXanLmzU/7kQHGPxYXdc3+ibhlYgaNKoTHdDn Ye+iTqWvtiVOov0prZGnMzjPLGEuS1H/w/wI/HpGlPESsQnZPYY6F9k/B1AO5sbFNEUie6 HmTfJ1945ZurGNkri9fhSsYL4xvuAy0LtU59T5N4RFWHqDwJrPlc4bcTzwJu8Q== ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1593027496; a=rsa-sha256; cv=none; b=HF37U7cNNhc5dGTB5yVDVU+Dh8WFQjwkLEd3l8wt2hDt2T0MCrleCzsip3nX1BOLFAbkmB 7oJHQG/CRN5B4UuJgLQeuWM2Z+zLyRUyvaYgncKGuxqT+mXLI2LJ7hELNQ7m1e+LBnCpSt J7tB1Y2hEGtP3FYAoLWdznnuf/148+SUYCh99Ion68om2pbCpv25a9+OHWXBPYA2XAvcS0 vWLd3s8mp3hcDQnGCleXcDRdH+ijVKE07D4+yOq+eVeAC+wFoT17of3/a/yJAg2Fx1Ke5x d94YGlYTTH6uJiL2W+TyqSNW2h07FHFPLMGcLhlmfbQkSHZKWCUIb88UJbTtqg== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi 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=fail (body hash did not verify) header.d=iki.fi header.s=lahtoruutu header.b=vaTT1haT; 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.99 X-TUID: jMjQ3dfRxSse On Wed, Jun 24 2020, David Bremner wrote: > Certain tests involving timestamps > 32bits cannot pass with the > current libnotmuch API. We will avoid this isssue for now by disabling s/isssue/issue/ > those tests on "old" architectures with 32bit time_t. > --- > configure | 33 ++++++++++++++++++++++++++++++++- > 1 file changed, 32 insertions(+), 1 deletion(-) > > diff --git a/configure b/configure > index 05ade05b..ecb0bdb7 100755 > --- a/configure > +++ b/configure > @@ -1045,6 +1045,34 @@ else > fi > rm -f compat/have_timegm > > +cat < _time_t.c > +#include > +#include > +int main(int argc, char**argv) { > + printf("%d\n",sizeof(time_t) >= 8); Since notmuch now (since fall 2018) requires c11 compiler, static_assert would be simpler alternative: #include #include static_assert(sizeof(time_t) >= 8, "sizeof(time_t) < 8"); and if ${CC} -c _time_t.c -o /dev/null > /dev/null 2>&1 then printf "Yes.\n" have_64bit_time_t=1 else printf "No.\n" have_64bit_time_t=0 fi but if not... > +} > +EOF > + > +printf "Checking for 64 bit time_t... " > +if ${CC} _time_t.c -o _time_t > /dev/null 2>&1; > +then > + have_64bit_time_t=$(./_time_t) anyway would be better for _time_t just exit 0 or 1 and set have_64bit_time_t as (inverse =D) of that (like above), ... but still, static_assert FTW \0/ ;) > + if [ $have_64bit_time_t -eq 1 ] > + then > + printf "Yes.\n" > + else > + printf "No.\n" > + fi > +else > + cat < + > +*** Error: compilation failed. Please try running configure again in > +a clean environment, and if the problem persists, report a bug. > +EOF > + rm -f _time_t _time_t.c exit 1 > +fi > + > + > printf "Checking for dirent.d_type... " > if ${CC} -o compat/have_d_type "$srcdir"/compat/have_d_type.c > /dev/null 2>&1 > then > @@ -1128,7 +1156,7 @@ for flag in -Wmissing-declarations; do > done > printf "\n\t%s\n" "${WARN_CFLAGS}" > > -rm -f minimal minimal.c _libversion.c _libversion _libversion.sh _check_session_keys.c _check_session_keys _check_x509_validity.c _check_x509_validity > +rm -f minimal minimal.c _time_t _time_t.c _libversion.c _libversion _libversion.sh _check_session_keys.c _check_session_keys _check_x509_validity.c _check_x509_validity > > # construct the Makefile.config > cat > Makefile.config < @@ -1429,6 +1457,9 @@ NOTMUCH_HAVE_MAN=$((have_sphinx)) > NOTMUCH_HAVE_BASH=${have_bash} > NOTMUCH_BASH_ABSOLUTE=${bash_absolute} > > +# Whether time_t is 64 bits (or more) > +NOTMUCH_HAVE_64BIT_TIME_T=${have_64bit_time_t} > + > # Whether perl exists, and if so where > NOTMUCH_HAVE_PERL=${have_perl} > NOTMUCH_PERL_ABSOLUTE=${perl_absolute} > -- > 2.27.0