]> granicus.if.org Git - postgresql/commit
Cast to (void *) rather than (int *) when passing int64's to PQfn().
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 8 Mar 2015 17:58:28 +0000 (13:58 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 8 Mar 2015 17:58:39 +0000 (13:58 -0400)
commitd16d821faa5a2c97e2fb532daa9a032b48129c91
tree584135fb6c3c9c1d0c27bec934d6c711e81a1353
parent9937f6e4c8ceba37ef840d550bc202c402d48113
Cast to (void *) rather than (int *) when passing int64's to PQfn().

This is a possibly-vain effort to silence a Coverity warning about
bogus endianness dependency.  The code's fine, because it takes care
of endianness issues for itself, but Coverity sees an int64 being
passed to an int* argument and not unreasonably suspects something's
wrong.  I'm not sure if putting the void* cast in the way will shut it
up; but it can't hurt and seems better from a documentation standpoint
anyway, since the pointer is not used as an int* in this code path.

Just for a bit of additional safety, verify that the result length
is 8 bytes as expected.

Back-patch to 9.3 where the code in question was added.
src/interfaces/libpq/fe-lobj.c