Re: [COMMITTERS] pgsql: Define integer limits independently from the system definitions. - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [COMMITTERS] pgsql: Define integer limits independently from the system definitions.
Date
Msg-id CAB7nPqTwN+HFUfZNMMJuWL6TquWEoVtfutvAQN9HMKOGYDUrTw@mail.gmail.com
Whole thread Raw
List pgsql-hackers
Hi Andres,

On Fri, Apr 3, 2015 at 12:45 AM, Andres Freund <andres@anarazel.de> wrote:
Define integer limits independently from the system definitions.

In 83ff1618 we defined integer limits iff they're not provided by the
system. That turns out not to be the greatest idea because there's
different ways some datatypes can be represented. E.g. on OSX PG's 64bit
datatype will be a 'long int', but OSX unconditionally uses 'long
long'. That disparity then can lead to warnings, e.g. around printf
formats.

This commit has added PG_INT16_MIN/MAX, however we still rely on SHRT_MIN and SHRT_MAX in some code paths. On all the platforms I looked at (OpenBSD, FreeBSD, MinGW, MSVC, OSX, Linux, Solaris) SHRT_MIN and SHRT_MAX definitions are always the same. Still, shouldn't we replace SHRT_* by their equivalent PG_INT16_* to be completely independent? I am just wondering if you considered that.
Regards,
--
Michael

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: pg_restore cancel TODO
Next
From: Bruce Momjian
Date:
Subject: Re: pg_restore cancel TODO