From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 147061F852 for ; Tue, 11 Jan 2022 20:21:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229593AbiAKUVQ (ORCPT ); Tue, 11 Jan 2022 15:21:16 -0500 Received: from bsmtp3.bon.at ([213.33.87.17]:40426 "EHLO bsmtp3.bon.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbiAKUVP (ORCPT ); Tue, 11 Jan 2022 15:21:15 -0500 Received: from [192.168.0.98] (unknown [93.83.142.38]) by bsmtp3.bon.at (Postfix) with ESMTPSA id 4JYMXS1XF8z5tlD; Tue, 11 Jan 2022 21:21:12 +0100 (CET) Message-ID: Date: Tue, 11 Jan 2022 21:21:11 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH 3/3] reftable tests: avoid "int" overflow, use "uint64_t" Content-Language: en-US To: Taylor Blau Cc: Han-Wen Nienhuys , =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , git@vger.kernel.org, Junio C Hamano , Johannes Schindelin References: <45baffd7-c9f3-cc52-47b4-ea0fee0182a8@kdbg.org> From: Johannes Sixt In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Am 11.01.22 um 21:18 schrieb Taylor Blau: > On Tue, Jan 11, 2022 at 09:08:46PM +0100, Johannes Sixt wrote: >> Am 11.01.22 um 20:41 schrieb Taylor Blau: >>> On Tue, Jan 11, 2022 at 08:31:47PM +0100, Han-Wen Nienhuys wrote: >>>> On Tue, Jan 11, 2022 at 8:28 PM Taylor Blau wrote: >>>>> In any case, you're only setting the lower half of `min` high. Maybe: >>>>> >>>>> uint64_t min = ~0ul; >>>> >>>> yeah, that works. >>> >>> I'm pretty sure this is OK on 32-bit systems, too, but confirmation from >>> somebody more confident than I in this area would be welcome :). >> >> It does not work on Windows: unsigned long is 32 bits wide. You have to >> make it >> >> uint64_t min = ~(uint64_t)0; > > Perfect; this is exactly what I was looking for. Thanks! Actually, on second thought, UINT64_MAX would be even better. -- Hannes