]> granicus.if.org Git - postgresql/commit
Arrange to supply declarations for strtoll/strtoull if needed.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 19 May 2018 02:42:10 +0000 (22:42 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 19 May 2018 02:42:10 +0000 (22:42 -0400)
commite9f475f991fb87afb39930a0aeee51fcfeeea042
treeede6e5cd0078be4c926c4b6933bd54a8670bab18
parentd73857d5719e10bc7ed8aabdf66daf03b1db7ddd
Arrange to supply declarations for strtoll/strtoull if needed.

Buildfarm member dromedary is still unhappy about the recently-added
ecpg "long long" tests.  The reason turns out to be that it includes
"-ansi" in its CFLAGS, and in their infinite wisdom Apple have decided
to hide the declarations of strtoll/strtoull in C89-compliant builds.
(I find it pretty curious that they hide those function declarations
when you can nonetheless declare a "long long" variable, but anyway
that is their behavior, both on dromedary's obsolete macOS version and
the newest and shiniest.)  As a result, gcc assumes these functions
return "int", leading naturally to wrong results.

(Looking at dromedary's past build results, it's evident that this
problem also breaks pg_strtouint64() on 32-bit platforms; but we
evidently have no regression tests that exercise that function with
values above 32 bits.)

To fix, supply declarations for these functions when the platform
provides the functions but not the declarations, using the same type
of mechanism as we use for some other similar cases.

Discussion: https://postgr.es/m/151935568942.1461.14623890240535309745@wrigleys.postgresql.org
configure
configure.in
src/include/c.h
src/include/pg_config.h.in
src/include/pg_config.h.win32