Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YcXFH-0004ne-51 for pgsql-committers@arkaria.postgresql.org; Mon, 30 Mar 2015 10:48:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YcXFG-0006Fe-7H for pgsql-committers@arkaria.postgresql.org; Mon, 30 Mar 2015 10:48:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YcXFA-00065g-La for pgsql-committers@postgresql.org; Mon, 30 Mar 2015 10:48:32 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YcXF5-0001jD-DX for pgsql-committers@postgresql.org; Mon, 30 Mar 2015 10:48:30 +0000 Received: from intern.anarazel.de (unknown [89.204.135.29]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id AEB4F860001; Mon, 30 Mar 2015 12:48:26 +0200 (CEST) Date: Mon, 30 Mar 2015 12:48:25 +0200 From: Andres Freund To: Michael Paquier Cc: pgsql-committers@postgresql.org Subject: Re: pgsql: Centralize definition of integer limits. Message-ID: <20150330104825.GE4878@alap3.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -4.2 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org Hi, On 2015-03-30 14:01:25 +0900, Michael Paquier wrote: > On Thu, Mar 26, 2015 at 6:49 AM, Andres Freund wrote: > > Centralize definition of integer limits. > > > > Several submitted and even committed patches have run into the problem > > that C89, our baseline, does not provide minimum/maximum values for > > various integer datatypes. C99's stdint.h does, but we can't rely on > > it. > > > > Several parts of the code defined limits locally, so instead centralize > > the definitions to c.h. > > > > This patch also changes the more obvious usages of literal limit values; > > there's more places that could be changed, but it's less clear whether > > it's beneficial to change those. > > My OSX dev box is generating a couple of warnings since this commit: > pg_dump.c:14548:45: warning: format specifies type 'long' but the argument > has type 'long long' [-Wformat] > snprintf(bufm, sizeof(bufm), INT64_FORMAT, SEQ_MINVALUE); > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ > ../../../src/include/pg_config_manual.h:52:22: note: expanded from macro > 'SEQ_MINVALUE' > #define SEQ_MINVALUE (-SEQ_MAXVALUE) > ^ > /usr/include/secure/_stdio.h:56:62: note: expanded from macro 'snprintf' > __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__) > ^ > pg_dump.c:14549:45: warning: format specifies type 'long' but the argument > has type 'long long' [-Wformat] > snprintf(bufx, sizeof(bufx), INT64_FORMAT, SEQ_MAXVALUE); > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ > ../../../src/include/pg_config_manual.h:51:22: note: expanded from macro > 'SEQ_MAXVALUE' > #define SEQ_MAXVALUE INT64_MAX > ^~~~~~~~~ > /usr/include/stdint.h:122:26: note: expanded from macro 'INT64_MAX' > #define INT64_MAX 9223372036854775807LL > ^~~~~~~~~~~~~~~~~~~~~ > /usr/include/secure/_stdio.h:56:62: note: expanded from macro 'snprintf' > __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__) Hm. Can you send config.log and the generated pg_config.h? Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers