pgsql: Rewrite pg_size_pretty() to avoid compiler bug. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Rewrite pg_size_pretty() to avoid compiler bug.
Date
Msg-id E1QFgWn-0002OE-Fg@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Rewrite pg_size_pretty() to avoid compiler bug.

Convert it to use successive shifts right instead of increasing a divisor.
This is probably a tad more efficient than the original coding, and it's
nicer-looking than the previous patch because we don't need a special case
to avoid overflow in the last branch.  But the real reason to do it is to
avoid a Solaris compiler bug, as per results from buildfarm member moa.

Branch
------
REL8_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/c5459735fd4d5ec8ea5ebfcd5dec03548d9ac8d4

Modified Files
--------------
src/backend/utils/adt/dbsize.c |   32 +++++++++++++-------------------
1 files changed, 13 insertions(+), 19 deletions(-)


pgsql-committers by date:

Previous
From: itagaki@pgfoundry.org (User Itagaki)
Date:
Subject: reorg - pg_reorg: Fixed database corruption when target tables have
Next
From: Tom Lane
Date:
Subject: pgsql: Rewrite pg_size_pretty() to avoid compiler bug.