Skip to content

Commit e9e2bde

Browse files
committed
Back-patch 9.4-era compiler warning fixes into older branches.
This applies portions of commits b64b5cc and b1aebbb 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.
1 parent 6b77a0e commit e9e2bde

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

contrib/pg_standby/pg_standby.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ SetWALFileNameForCleanup(void)
358358
if (keepfiles > 0)
359359
{
360360
sscanf(nextWALFileName, "%08X%08X%08X", &tli, &log, &seg);
361-
if (tli > 0 && log >= 0 && seg > 0)
361+
if (tli > 0 && seg > 0)
362362
{
363363
log_diff = keepfiles / MaxSegmentsPerLogFile;
364364
seg_diff = keepfiles % MaxSegmentsPerLogFile;

src/interfaces/libpq/fe-exec.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2897,7 +2897,7 @@ PQoidStatus(const PGresult *res)
28972897

28982898
size_t len;
28992899

2900-
if (!res || !res->cmdStatus || strncmp(res->cmdStatus, "INSERT ", 7) != 0)
2900+
if (!res || strncmp(res->cmdStatus, "INSERT ", 7) != 0)
29012901
return "";
29022902

29032903
len = strspn(res->cmdStatus + 7, "0123456789");
@@ -2921,7 +2921,6 @@ PQoidValue(const PGresult *res)
29212921
unsigned long result;
29222922

29232923
if (!res ||
2924-
!res->cmdStatus ||
29252924
strncmp(res->cmdStatus, "INSERT ", 7) != 0 ||
29262925
res->cmdStatus[7] < '0' ||
29272926
res->cmdStatus[7] > '9')

0 commit comments

Comments
 (0)