Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g7lJL-0001lN-Bj for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Oct 2018 17:51:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g7lJJ-00057N-3n for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Oct 2018 17:51:45 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g7lJI-00057G-PL for pgsql-hackers@lists.postgresql.org; Wed, 03 Oct 2018 17:51:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g7lJG-0007WZ-DA for pgsql-hackers@lists.postgresql.org; Wed, 03 Oct 2018 17:51:43 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w93Hpcia002846; Wed, 3 Oct 2018 13:51:38 -0400 From: Tom Lane To: Andres Freund cc: Alexander Kuzmenkov , pgsql-hackers@lists.postgresql.org Subject: Re: Performance improvements for src/port/snprintf.c In-reply-to: <20181003173936.uv3udmpovqizg4x6@alap3.anarazel.de> References: <14302.1538005507@sss.pgh.pa.us> <20180926235821.zmpxqv66ob7v2ffi@alap3.anarazel.de> <15882.1538007944@sss.pgh.pa.us> <20180927004022.lfhffbj3roxzf5ca@alap3.anarazel.de> <20180927005705.shbl3n5hq3t65n2j@alap3.anarazel.de> <20180927011814.kpncoksuqq3gy44s@alap3.anarazel.de> <15652.1538011825@sss.pgh.pa.us> <20181002201328.kauaofescppm54gq@alap3.anarazel.de> <30898.1538517873@sss.pgh.pa.us> <1680.1538587115@sss.pgh.pa.us> <20181003173936.uv3udmpovqizg4x6@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Wed, 03 Oct 2018 10:39:36 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2844.1538589098.1@sss.pgh.pa.us> Date: Wed, 03 Oct 2018 13:51:38 -0400 Message-ID: <2845.1538589098@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > On 2018-10-03 13:18:35 -0400, Tom Lane wrote: >> Having said that, maybe there's a case for changing the type spec >> in only the va_arg() call, and leaving snprintf's related local >> variables as int64. (Is that what you actually meant?) Then, >> if long long really is different from int64, at least we have >> predictable truncation behavior after fetching the value, rather >> than undefined behavior while fetching it. > Hm. I guess that'd be a bit better, but I'm not sure it's worth it. How > about we simply add a static assert that long long isn't bigger than > int64? WFM, I'll make it happen. regards, tom lane