From: Vadim B. Mikheev Date: Sat, 14 Dec 1996 07:56:05 +0000 (+0000) Subject: Avoiding: X-Git-Tag: REL6_1~867 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4556a50cf844dc61bda81eb109dd116dcdbe0412;p=postgresql Avoiding: cc1: warnings being treated as errors datum.c: In function `DatumGetSize': datum.c:57: warning: unsigned value >= 0 is always 1 gmake[3]: *** [datum.o] Error 1 There was: if (byVal) { if (len >= 0 && len <= sizeof(Datum)) { but len has type Size (unsigned int) and so now there is: if (byVal) { if (len <= sizeof(Datum)) { --- diff --git a/src/backend/utils/adt/datum.c b/src/backend/utils/adt/datum.c index 11efd89e7a..20bc38cc1a 100644 --- a/src/backend/utils/adt/datum.c +++ b/src/backend/utils/adt/datum.c @@ -6,7 +6,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/datum.c,v 1.3 1996/11/08 05:59:41 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/datum.c,v 1.4 1996/12/14 07:56:05 vadim Exp $ * *------------------------------------------------------------------------- */ @@ -54,7 +54,7 @@ datumGetSize(Datum value, Oid type, bool byVal, Size len) Size size = 0; if (byVal) { - if (len >= 0 && len <= sizeof(Datum)) { + if (len <= sizeof(Datum)) { size = len; } else { elog(WARN,