Re: clang's static checker report.
От | Tom Lane |
---|---|
Тема | Re: clang's static checker report. |
Дата | |
Msg-id | 28388.1251048666@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: clang's static checker report. (Greg Stark <gsstark@mit.edu>) |
Ответы |
Re: clang's static checker report.
|
Список | pgsql-hackers |
Greg Stark <gsstark@mit.edu> writes: > On Sun, Aug 23, 2009 at 6:11 PM, Grzegorz Jaskiewicz<gj@pointblue.com.pl> wrote: >> http://zlew.org/postgresql_static_check/scan-build-2009-08-23-5/report-MAVb5D.html#EndPath >> for a very positive one - at least from strict language point of view. >> >> consider: float f = 100000000; f++; printf("%f\n", f); > I believe the maximum value of the numbers involved here is the sample > size which is currently capped at 10,000. But I'm not exactly sure. No, the maximum value is somewhere around the maximum number of rows in a table, which is on the rough order of 4e12, which is several orders of magnitude below the threshold at which counting in a double becomes inaccurate. It is, however, above the point at which counting in an int32 will overflow. So the alternative would be to assume that we have a working int64 data type, which doesn't strike me as an improvement in the portability of the code. regards, tom lane
В списке pgsql-hackers по дате отправления: