From e9e2bde2d29ceed3817434b85a4dfef84fb25556 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 17 Feb 2017 16:58:26 -0500 Subject: Back-patch 9.4-era compiler warning fixes into older branches. This applies portions of commits b64b5ccb6 and b1aebbb6a to the older branches, in hopes of getting -Werror builds to succeed there. The applied changes simply remove useless tests, eg checking an unsigned variable to see if it is >= 0. Recent versions of clang warn about such tests by default. --- src/interfaces/libpq/fe-exec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c index a5ea452d8d7..6be86dcf695 100644 --- a/src/interfaces/libpq/fe-exec.c +++ b/src/interfaces/libpq/fe-exec.c @@ -2897,7 +2897,7 @@ PQoidStatus(const PGresult *res) size_t len; - if (!res || !res->cmdStatus || strncmp(res->cmdStatus, "INSERT ", 7) != 0) + if (!res || strncmp(res->cmdStatus, "INSERT ", 7) != 0) return ""; len = strspn(res->cmdStatus + 7, "0123456789"); @@ -2921,7 +2921,6 @@ PQoidValue(const PGresult *res) unsigned long result; if (!res || - !res->cmdStatus || strncmp(res->cmdStatus, "INSERT ", 7) != 0 || res->cmdStatus[7] < '0' || res->cmdStatus[7] > '9') -- cgit v1.2.3