pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Cast to (void *) rather than (int *) when passing int64's to PQf 3+ messages / 1 participants [nested] [flat]
* pgsql: Cast to (void *) rather than (int *) when passing int64's to PQf @ 2015-03-08 17:58 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2015-03-08 17:58 UTC (permalink / raw) To: pgsql-committers 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. Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/ef75508efc789c79c5a5d4acd7ad5da85f1e4f08 Modified Files -------------- src/interfaces/libpq/fe-lobj.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 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] 3+ messages in thread
* pgsql: Cast to (void *) rather than (int *) when passing int64's to PQf @ 2015-03-08 17:58 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2015-03-08 17:58 UTC (permalink / raw) To: pgsql-committers 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. Branch ------ REL9_4_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/3d0d3c02fff4d0c919eed28fb0d6d4b45857a408 Modified Files -------------- src/interfaces/libpq/fe-lobj.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 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] 3+ messages in thread
* pgsql: Cast to (void *) rather than (int *) when passing int64's to PQf @ 2015-03-08 17:58 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2015-03-08 17:58 UTC (permalink / raw) To: pgsql-committers 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. Branch ------ REL9_3_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/d16d821faa5a2c97e2fb532daa9a032b48129c91 Modified Files -------------- src/interfaces/libpq/fe-lobj.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 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] 3+ messages in thread
end of thread, other threads:[~2015-03-08 17:58 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2015-03-08 17:58 pgsql: Cast to (void *) rather than (int *) when passing int64's to PQf Tom Lane <tgl@sss.pgh.pa.us> 2015-03-08 17:58 pgsql: Cast to (void *) rather than (int *) when passing int64's to PQf Tom Lane <tgl@sss.pgh.pa.us> 2015-03-08 17:58 pgsql: Cast to (void *) rather than (int *) when passing int64's to PQf 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