pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Make [U]INT64CONST safe for use in #if conditions.
7+ messages / 1 participants
[nested] [flat]

* pgsql: Make [U]INT64CONST safe for use in #if conditions.
@ 2017-09-01 19:14  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2017-09-01 19:14 UTC (permalink / raw)
  To: pgsql-committers

Make [U]INT64CONST safe for use in #if conditions.

Instead of using a cast to force the constant to be the right width,
assume we can plaster on an L, UL, LL, or ULL suffix as appropriate.
The old approach to this is very hoary, dating from before we were
willing to require compilers to have working int64 types.

This fix makes the PG_INT64_MIN, PG_INT64_MAX, and PG_UINT64_MAX
constants safe to use in preprocessor conditions, where a cast
doesn't work.  Other symbolic constants that might be defined using
[U]INT64CONST are likewise safer than before.

Also fix the SIZE_MAX macro to be similarly safe, if we are forced
to provide a definition for that.  The test added in commit 2e70d6b5e
happens to do what we want even with the hack "(size_t) -1" definition,
but we could easily get burnt on other tests in future.

Back-patch to all supported branches, like the previous commits.

Discussion: https://postgr.es/m/15883.1504278595@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9d6b160d7db76809f0c696d9073f6955dd5a973a

Modified Files
--------------
configure                     | 18 ------------------
configure.in                  | 12 ------------
src/include/c.h               | 21 ++++++++++-----------
src/include/pg_config.h.in    |  4 ----
src/include/pg_config.h.win32 |  8 +-------
5 files changed, 11 insertions(+), 52 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Make [U]INT64CONST safe for use in #if conditions.
@ 2017-09-01 19:14  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2017-09-01 19:14 UTC (permalink / raw)
  To: pgsql-committers

Make [U]INT64CONST safe for use in #if conditions.

Instead of using a cast to force the constant to be the right width,
assume we can plaster on an L, UL, LL, or ULL suffix as appropriate.
The old approach to this is very hoary, dating from before we were
willing to require compilers to have working int64 types.

This fix makes the PG_INT64_MIN, PG_INT64_MAX, and PG_UINT64_MAX
constants safe to use in preprocessor conditions, where a cast
doesn't work.  Other symbolic constants that might be defined using
[U]INT64CONST are likewise safer than before.

Also fix the SIZE_MAX macro to be similarly safe, if we are forced
to provide a definition for that.  The test added in commit 2e70d6b5e
happens to do what we want even with the hack "(size_t) -1" definition,
but we could easily get burnt on other tests in future.

Back-patch to all supported branches, like the previous commits.

Discussion: https://postgr.es/m/15883.1504278595@sss.pgh.pa.us

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f2fe1cbef11c5fc962e338c8523667314faa6d89

Modified Files
--------------
configure                     | 18 ------------------
configure.in                  | 12 ------------
src/include/c.h               | 21 ++++++++++-----------
src/include/pg_config.h.in    |  4 ----
src/include/pg_config.h.win32 |  8 +-------
5 files changed, 11 insertions(+), 52 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Make [U]INT64CONST safe for use in #if conditions.
@ 2017-09-01 19:14  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2017-09-01 19:14 UTC (permalink / raw)
  To: pgsql-committers

Make [U]INT64CONST safe for use in #if conditions.

Instead of using a cast to force the constant to be the right width,
assume we can plaster on an L, UL, LL, or ULL suffix as appropriate.
The old approach to this is very hoary, dating from before we were
willing to require compilers to have working int64 types.

This fix makes the PG_INT64_MIN, PG_INT64_MAX, and PG_UINT64_MAX
constants safe to use in preprocessor conditions, where a cast
doesn't work.  Other symbolic constants that might be defined using
[U]INT64CONST are likewise safer than before.

Also fix the SIZE_MAX macro to be similarly safe, if we are forced
to provide a definition for that.  The test added in commit 2e70d6b5e
happens to do what we want even with the hack "(size_t) -1" definition,
but we could easily get burnt on other tests in future.

Back-patch to all supported branches, like the previous commits.

Discussion: https://postgr.es/m/15883.1504278595@sss.pgh.pa.us

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3a0f8e7d3f9a54ab34b69d1fc8c9f7806d67521a

Modified Files
--------------
configure                     | 18 ------------------
configure.in                  | 12 ------------
src/include/c.h               | 21 ++++++++++-----------
src/include/pg_config.h.in    |  4 ----
src/include/pg_config.h.win32 |  8 +-------
5 files changed, 11 insertions(+), 52 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Make [U]INT64CONST safe for use in #if conditions.
@ 2017-09-01 19:14  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2017-09-01 19:14 UTC (permalink / raw)
  To: pgsql-committers

Make [U]INT64CONST safe for use in #if conditions.

Instead of using a cast to force the constant to be the right width,
assume we can plaster on an L, UL, LL, or ULL suffix as appropriate.
The old approach to this is very hoary, dating from before we were
willing to require compilers to have working int64 types.

This fix makes the PG_INT64_MIN, PG_INT64_MAX, and PG_UINT64_MAX
constants safe to use in preprocessor conditions, where a cast
doesn't work.  Other symbolic constants that might be defined using
[U]INT64CONST are likewise safer than before.

Also fix the SIZE_MAX macro to be similarly safe, if we are forced
to provide a definition for that.  The test added in commit 2e70d6b5e
happens to do what we want even with the hack "(size_t) -1" definition,
but we could easily get burnt on other tests in future.

Back-patch to all supported branches, like the previous commits.

Discussion: https://postgr.es/m/15883.1504278595@sss.pgh.pa.us

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1305186de4257cb342bc3b8b0b899cfc00e79c7d

Modified Files
--------------
configure                     | 25 -------------------------
configure.in                  | 13 -------------
src/include/c.h               | 21 ++++++++++-----------
src/include/pg_config.h.in    |  4 ----
src/include/pg_config.h.win32 |  8 +-------
5 files changed, 11 insertions(+), 60 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Make [U]INT64CONST safe for use in #if conditions.
@ 2017-09-01 19:14  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2017-09-01 19:14 UTC (permalink / raw)
  To: pgsql-committers

Make [U]INT64CONST safe for use in #if conditions.

Instead of using a cast to force the constant to be the right width,
assume we can plaster on an L, UL, LL, or ULL suffix as appropriate.
The old approach to this is very hoary, dating from before we were
willing to require compilers to have working int64 types.

This fix makes the PG_INT64_MIN, PG_INT64_MAX, and PG_UINT64_MAX
constants safe to use in preprocessor conditions, where a cast
doesn't work.  Other symbolic constants that might be defined using
[U]INT64CONST are likewise safer than before.

Also fix the SIZE_MAX macro to be similarly safe, if we are forced
to provide a definition for that.  The test added in commit 2e70d6b5e
happens to do what we want even with the hack "(size_t) -1" definition,
but we could easily get burnt on other tests in future.

Back-patch to all supported branches, like the previous commits.

Discussion: https://postgr.es/m/15883.1504278595@sss.pgh.pa.us

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/53863ebeba5fa103022c5fe47cd35314b952be59

Modified Files
--------------
configure                     | 25 -------------------------
configure.in                  | 13 -------------
src/include/c.h               | 19 +++++++++----------
src/include/pg_config.h.in    |  4 ----
src/include/pg_config.h.win32 |  8 +-------
5 files changed, 10 insertions(+), 59 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Make [U]INT64CONST safe for use in #if conditions.
@ 2017-09-01 19:14  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2017-09-01 19:14 UTC (permalink / raw)
  To: pgsql-committers

Make [U]INT64CONST safe for use in #if conditions.

Instead of using a cast to force the constant to be the right width,
assume we can plaster on an L, UL, LL, or ULL suffix as appropriate.
The old approach to this is very hoary, dating from before we were
willing to require compilers to have working int64 types.

This fix makes the PG_INT64_MIN, PG_INT64_MAX, and PG_UINT64_MAX
constants safe to use in preprocessor conditions, where a cast
doesn't work.  Other symbolic constants that might be defined using
[U]INT64CONST are likewise safer than before.

Also fix the SIZE_MAX macro to be similarly safe, if we are forced
to provide a definition for that.  The test added in commit 2e70d6b5e
happens to do what we want even with the hack "(size_t) -1" definition,
but we could easily get burnt on other tests in future.

Back-patch to all supported branches, like the previous commits.

Discussion: https://postgr.es/m/15883.1504278595@sss.pgh.pa.us

Branch
------
REL9_3_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/dd344de6718ba144e6c6def5b095bf4e220733a0

Modified Files
--------------
configure                     | 54 -------------------------------------------
configure.in                  | 13 -----------
src/include/c.h               | 19 ++++++++-------
src/include/pg_config.h.in    |  4 ----
src/include/pg_config.h.win32 |  8 +------
5 files changed, 10 insertions(+), 88 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Make [U]INT64CONST safe for use in #if conditions.
@ 2017-09-01 19:14  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2017-09-01 19:14 UTC (permalink / raw)
  To: pgsql-committers

Make [U]INT64CONST safe for use in #if conditions.

Instead of using a cast to force the constant to be the right width,
assume we can plaster on an L, UL, LL, or ULL suffix as appropriate.
The old approach to this is very hoary, dating from before we were
willing to require compilers to have working int64 types.

This fix makes the PG_INT64_MIN, PG_INT64_MAX, and PG_UINT64_MAX
constants safe to use in preprocessor conditions, where a cast
doesn't work.  Other symbolic constants that might be defined using
[U]INT64CONST are likewise safer than before.

Also fix the SIZE_MAX macro to be similarly safe, if we are forced
to provide a definition for that.  The test added in commit 2e70d6b5e
happens to do what we want even with the hack "(size_t) -1" definition,
but we could easily get burnt on other tests in future.

Back-patch to all supported branches, like the previous commits.

Discussion: https://postgr.es/m/15883.1504278595@sss.pgh.pa.us

Branch
------
REL9_2_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f60a236bab805c2aaf6818940f1b2ce04f4a7081

Modified Files
--------------
configure                     | 54 -------------------------------------------
configure.in                  | 13 -----------
src/include/c.h               | 19 ++++++++-------
src/include/pg_config.h.in    |  4 ----
src/include/pg_config.h.win32 |  8 +------
5 files changed, 10 insertions(+), 88 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2017-09-01 19:14 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-09-01 19:14 pgsql: Make [U]INT64CONST safe for use in #if conditions. Tom Lane <tgl@sss.pgh.pa.us>
2017-09-01 19:14 pgsql: Make [U]INT64CONST safe for use in #if conditions. Tom Lane <tgl@sss.pgh.pa.us>
2017-09-01 19:14 pgsql: Make [U]INT64CONST safe for use in #if conditions. Tom Lane <tgl@sss.pgh.pa.us>
2017-09-01 19:14 pgsql: Make [U]INT64CONST safe for use in #if conditions. Tom Lane <tgl@sss.pgh.pa.us>
2017-09-01 19:14 pgsql: Make [U]INT64CONST safe for use in #if conditions. Tom Lane <tgl@sss.pgh.pa.us>
2017-09-01 19:14 pgsql: Make [U]INT64CONST safe for use in #if conditions. Tom Lane <tgl@sss.pgh.pa.us>
2017-09-01 19:14 pgsql: Make [U]INT64CONST safe for use in #if conditions. Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox