Re: Missing SIZE_MAX
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>,
"pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2017-09-01T18:25:32Z
Lists: pgsql-hackers
Attachments
- make-INT64CONST-macro-safe-for-#if.patch (text/x-diff) patch
I wrote: > Robert Haas <robertmhaas@gmail.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
Commits
-
Make [U]INT64CONST safe for use in #if conditions.
- 9d6b160d7db7 11.0 landed
- f60a236bab80 9.2.24 landed
- f2fe1cbef11c 10.0 landed
- dd344de6718b 9.3.20 landed
- 53863ebeba5f 9.4.15 landed
- 3a0f8e7d3f9a 9.6.6 landed
- 1305186de425 9.5.10 landed
-
Ensure SIZE_MAX can be used throughout our code.
- bf387028554f 9.5.10 landed
- 9a98557662a9 9.4.15 landed
- 0bfcda990405 9.2.24 landed
- 074985b26a43 9.3.20 landed
- e50d401a8396 9.6.6 landed
- cbb51eb69f3f 10.0 landed
- b79d69b08756 11.0 landed
-
Teach libpq to detect integer overflow in the row count of a PGresult.
- 2e70d6b5e99b 11.0 cited