]> granicus.if.org Git - postgresql/commit
Second try at fixing warnings caused by commit 9b43d73b3f9bef27.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 4 May 2015 03:44:52 +0000 (23:44 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 4 May 2015 03:44:52 +0000 (23:44 -0400)
commitc90b85e4d9e4ae3bc26459cc54697e1adaa4315f
tree1a80dfc2a4f14e963c574e2a8c1241dcbc8409ba
parenta4820434c1a62e0c5f4051a31ad8b4a11f0a6ad7
Second try at fixing warnings caused by commit 9b43d73b3f9bef27.

Commit ef3f9e642d2b2bba suppressed one cause of warnings here, but
recent clang on OS X is still unhappy because we're passing a "long"
to abs().  The fact that tm_gmtoff is declared as long is no doubt a
hangover from days when int might be only 16 bits; but Postgres has
never been able to run on such machines, so we can just cast it to int
with no worries.  For consistency, also cast to int in the other
uses of tm_gmtoff in this stanza.

Note: this code is still broken on machines that don't follow C99
integer-division-truncates-towards-zero rules.  Given the lack of
complaints about it, I don't feel a large desire to complicate things
enough to cope with the pre-C99 rules.
src/backend/utils/adt/formatting.c