Re: pgsql: Centralize definition of integer limits.

From: Andres Freund <andres(at)anarazel(dot)de>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Centralize definition of integer limits.
Date: 2015-03-30 10:51:24
Message-ID: 20150330105124.GF4878@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 2015-03-30 14:27:20 +0900, Michael Paquier wrote:
> INT64_MODIFIER is "l" on OSX, causing this warning. Perhaps there is
> something better to do instead of casting blindly to int64. Thoughts?
> --
> Michael

> diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
> index 7da5c41..a15c875 100644
> --- a/src/bin/pg_dump/pg_dump.c
> +++ b/src/bin/pg_dump/pg_dump.c
> @@ -14545,8 +14545,8 @@ dumpSequence(Archive *fout, DumpOptions *dopt, TableInfo *tbinfo)
> /* Make sure we are in proper schema */
> selectSourceSchema(fout, tbinfo->dobj.namespace->dobj.name);
>
> - snprintf(bufm, sizeof(bufm), INT64_FORMAT, SEQ_MINVALUE);
> - snprintf(bufx, sizeof(bufx), INT64_FORMAT, SEQ_MAXVALUE);
> + snprintf(bufm, sizeof(bufm), INT64_FORMAT, (int64) SEQ_MINVALUE);
> + snprintf(bufx, sizeof(bufx), INT64_FORMAT, (int64) SEQ_MAXVALUE);
>

I think that's entirely the wrong approach. ISTM that, independent from
this patch, INT64CONST/HAVE_LL_CONSTANTS are wrong for your
environment. The HAVE_LL_CONSTANTS test is probably too simplistic.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2015-03-30 11:09:12 Re: pgsql: Centralize definition of integer limits.
Previous Message Andres Freund 2015-03-30 10:48:25 Re: pgsql: Centralize definition of integer limits.

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2015-03-30 10:52:46 WIP: SCRAM authentication
Previous Message Andres Freund 2015-03-30 10:48:25 Re: pgsql: Centralize definition of integer limits.