Re: INT64_MIN and _MAX

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: kgrittn(at)ymail(dot)com, andres(at)anarazel(dot)de, petr(at)2ndquadrant(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: INT64_MIN and _MAX
Date: 2015-03-25 02:07:45
Message-ID: 87lhil6dpi.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>>>> "Kyotaro" == Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> writes:

Kyotaro> Hello,
Kyotaro> Grep showed me some unfixed usages of bare constant or
Kyotaro> INT64CONST as (u)int64 max/min values.

Kyotaro> ./src/interfaces/ecpg/pgtypeslib/dt.h:

I didn't touch the ecpg stuff since it wasn't too clear that it was safe
to change, but on second look it is.

Kyotaro> ./contrib/pgcrypto/imath.h:

I didn't touch this since it was obviously a library copied from
somewhere else.

Kyotaro> ./src/backend/utils/mb/wchar.c
Kyotaro> ./src/bin/psql/mbprint.c:
>> return 0xffffffff;

Here 0xffffffff is not a uint or uint32, but a pg_wchar (which is
unsigned int, not uint32). What's needed there is not UINT_MAX but
rather a PG_WCHAR_INVALID or similar definition in pg_wchar.h.

--
Andrew (irc:RhodiumToad)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Hernández Tortosa 2015-03-25 02:08:45 Re: Repeatable read and serializable transactions see data committed after tx start
Previous Message Michael Paquier 2015-03-25 02:05:58 Re: Error with index on unlogged table