Re: [HACKERS] [PATCH] quiet conversion warning in DatumGetFloat4 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] [PATCH] quiet conversion warning in DatumGetFloat4
Date
Msg-id 5894.1496208390@sss.pgh.pa.us
Whole thread Raw
In response to [HACKERS] [PATCH] quiet conversion warning in DatumGetFloat4  (Chapman Flack <chap@anastigmatix.net>)
Responses Re: [HACKERS] [PATCH] quiet conversion warning in DatumGetFloat4  (Chapman Flack <chap@anastigmatix.net>)
List pgsql-hackers
Chapman Flack <chap@anastigmatix.net> writes:
> -    myunion.value = GET_4_BYTES(X);
> +    myunion.value = (int32)GET_4_BYTES(X);

Hm.  I think it would be better to use DatumGetInt32 here.  Arguably,
direct use of GET_4_BYTES and its siblings should only appear in
DatumGetFoo macros.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: [HACKERS] TAP backpatching policy
Next
From: Chapman Flack
Date:
Subject: Re: [HACKERS] [PATCH] quiet conversion warning in DatumGetFloat4