Re: [PATCH] quiet conversion warning in DatumGetFloat4

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Chapman Flack <chap(at)anastigmatix(dot)net>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] quiet conversion warning in DatumGetFloat4
Date: 2017-06-01 22:20:50
Message-ID: 20516.1496355650@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Chapman Flack <chap(at)anastigmatix(dot)net> writes:
> It might be fun to see how big a chunk of the 4106 would vanish just
> with the first tweak to one of the causes that's mentioned in a lot of
> them. (Unless your figures were already after culling to distinct causes,
> which would sound like a more-than-casual effort.)

No, I just did "make 2>&1 | grep 'warning: conversion' | wc".

I did look through the warnings a little bit. A lot of them seem to be
caused by our being cavalier about using "int" parameters and/or loop
variables to represent attribute numbers; as soon as you pass one of those
to an API that's declared AttrNumber, warning. Another large batch are
from conversions from size_t to int, a practice that's perfectly safe for
palloc'd values. And I saw some in the planner from conversions of
rowcounts to double --- yes, I know that's imprecise, thank you very much.
Based on what I saw, there are hardly any places where a single touch
would remove a large number of these warnings; it'd be more like fixing
them retail, and it would be pretty pointless.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Kirkwood 2017-06-01 22:46:22 Re: logical replication - still unstable after all these months
Previous Message Tom Lane 2017-06-01 22:05:45 Re: BEFORE trigger can cause undetected partition constraint violation