Re: Missing SIZE_MAX

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Missing SIZE_MAX
Date: 2017-09-01 18:25:32
Message-ID: 26331.1504290332@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> It might be worth the effort to clean all of this up, just because the
>> next person who gets bitten by it may not be as smart as you are.

> Yeah. I was just thinking that maybe the appropriate investment of
> effort is to make [U]INT64CONST smarter, so that it results in a
> properly-suffixed constant and doesn't need a cast. Then it'd be a
> lot easier to make these other macros be #if-safe.

Actually, that looks easier than I thought. The current approach to
[U]INT64CONST dates to before we were willing to require the compiler
to have working 64-bit support. I think that now we can just assume
that either an L/UL or LL/ULL suffix will work, as in the attached
draft. (This'd allow dropping configure's HAVE_LL_CONSTANTS probe
entirely, but I didn't do that yet.)

regards, tom lane

Attachment Content-Type Size
make-INT64CONST-macro-safe-for-#if.patch text/x-diff 2.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Steele 2017-09-01 18:31:41 Re: Rename RECOVERYXLOG to RECOVERYWAL?
Previous Message Daniel Gustafsson 2017-09-01 18:11:09 Re: GnuTLS support