Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oqrzd-0006xM-Bq for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Nov 2022 08:24:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oqrzc-0007yO-3V for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Nov 2022 08:24:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oqrzb-0007xH-O8 for pgsql-hackers@lists.postgresql.org; Fri, 04 Nov 2022 08:23:59 +0000 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oqrzZ-0007o8-MQ for pgsql-hackers@lists.postgresql.org; Fri, 04 Nov 2022 08:23:59 +0000 Received: by mail-ed1-x529.google.com with SMTP id i21so6491551edj.10 for ; Fri, 04 Nov 2022 01:23:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ka+54fUp79EZiB+S1qhpYcHl/1jpPKb8LhZvcLLavHA=; b=ENBf+51S2NbjVMbDYhenG4uJjxf5LQVbsCL7EPp1pLxGE//lY/GE8/UtEmgDbJEOw6 FoilpJdRzLbAFOOrK9gbm8UCLcM+ds6snA4kG+yZB62630VAqRTfZzxLPoK0zy2Gyia4 Hh8JY/Y2uaBK2fTzcFjmevIrjrgs7CAYK/Kpd5nrhO6NulAyChZ2l/hd5iU661HoXMD9 dRE/240lV3eF1ps/AOV2nqKpnbvX6cl06GQ+WDnIoW+R20AuFAmZVXHC0X6TftkYS/1J qt2K31ijvoD78ZNQ+Ha7XaS/pEiJ9+sxC98DSgEPOUdK0UeFflDuvuW0q+fSWf8D7WO8 +WUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ka+54fUp79EZiB+S1qhpYcHl/1jpPKb8LhZvcLLavHA=; b=MQqaC3/oIrn1IC4Orh+6UnJqCsafE6kv0qEXwp5sRLZ1jf8sNt3/CdfQ1gt3ZlYlfU nS/XfSbV3y2mEyN9Oc77fkEhmHzu95NE8hVUFgQRfp/SmGWYWWB9LsnTvqTcvqz1EVcq /0+pwwBpkdMm52WCTIqn1V+ZyXvtYHZH2CuHJwoeQX4XwOutKIe7lmgnGM8kxGVZc4ZH wlpSFwcPe9Cfs4arzyMt4il/MblBn6oz0FeWYqQYO/zd8kP2cAU0P2YtYI/bVyUzDUQJ LYM+4tj36v52lBxpMwyqKdrtprV9wH137pwx6bz4xB8mXcKR56oQTbosIiZQIh3T4/lv vTaQ== X-Gm-Message-State: ACrzQf0lnRv9zFAHaIGa1RmTUyITPQVILDHzqinxscO2khKbTdOsJCZd mR0vX4oUfcCb2jZWzLujwPPYScIleBUwAw== X-Google-Smtp-Source: AMsMyM6Wue3cPxDVkxdrMu96Qfb7GvfSosXTWzUqD4/OdHt01B+jXfDjutVip0MWYoS4LFBazG+Cgw== X-Received: by 2002:a50:aad7:0:b0:461:d726:438f with SMTP id r23-20020a50aad7000000b00461d726438fmr267364edc.333.1667550236326; Fri, 04 Nov 2022 01:23:56 -0700 (PDT) Received: from [172.16.209.129] ([147.161.235.10]) by smtp.gmail.com with ESMTPSA id s15-20020aa7d78f000000b0046447e4e903sm1529931edq.32.2022.11.04.01.23.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Nov 2022 01:23:55 -0700 (PDT) Message-ID: <0f0d2561-1190-1f45-0c5f-ed42f2c80aaf@gmail.com> Date: Fri, 4 Nov 2022 09:23:54 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: Add explicit casts in four places to simplehash.h Content-Language: en-US To: Tom Lane Cc: PostgreSQL Developers References: <2063437.1667487018@sss.pgh.pa.us> From: David Geier In-Reply-To: <2063437.1667487018@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 11/3/22 15:50, Tom Lane wrote: > Seems reasonable, so done (I fixed one additional spot you missed). Thanks! > The bigger picture here is that we do actually endeavor to keep > (most of) our headers C++ clean, but our tool cpluspluscheck misses > these problems because it doesn't try to use these macros. > I wonder whether there is a way to do better. What about having a custom header alongside cpluspluscheck which references all macros we care about? We could start with the really big macros like the ones from simplehash.h and add as we go. I could give this a try if deemed useful. -- David Geier (ServiceNow)