Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb43bf61

Browse files
committed
Tweak PQresStatus() to avoid a clang compiler warning.
The previous test for status < 0 test is in fact testing nothing if thecompiler considers an enum to be an unsigned data type. clang doesn'tlike tautologies, so do this instead.Report by Peter Geoghegan, fix as suggested by Tom Lane.
1 parent4262e61 commitb43bf61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/interfaces/libpq/fe-exec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2386,7 +2386,7 @@ PQresultStatus(const PGresult *res)
23862386
char*
23872387
PQresStatus(ExecStatusTypestatus)
23882388
{
2389-
if (status<0||status >=sizeofpgresStatus /sizeofpgresStatus[0])
2389+
if ((unsignedint)status >=sizeofpgresStatus /sizeofpgresStatus[0])
23902390
returnlibpq_gettext("invalid ExecStatusType code");
23912391
returnpgresStatus[status];
23922392
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp