Re: Missing SIZE_MAX
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2017-09-01T15:48:46Z
Lists: pgsql-hackers
On Fri, Sep 1, 2017 at 11:09 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > Commit 2e70d6b5e added a dependency on SIZE_MAX to libpq/fe_exec.c. > According to C99 and recent POSIX, that symbol should be provided > by <stdint.h>, but SUS v2 (POSIX 2001) doesn't require <stdint.h> > to exist at all ... and I now notice that gaur/pademelon doesn't > have it, and unsurprisingly is failing to compile fe_exec.c. > > We have a workaround for that symbol in timezone/private.h: > > #ifndef SIZE_MAX > #define SIZE_MAX ((size_t) -1) > #endif > > and a bit of grepping finds other places that are using the (size_t) -1 > trick explicitly. So what I'm tempted to do is move the above stanza > into c.h. Any objections? Not from me. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
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