Re: clang's static checker report. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: clang's static checker report.
Date
Msg-id 28388.1251048666@sss.pgh.pa.us
Whole thread Raw
In response to Re: clang's static checker report.  (Greg Stark <gsstark@mit.edu>)
Responses Re: clang's static checker report.  (Grzegorz Jaskiewicz <gj@pointblue.com.pl>)
List 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 by date:

Previous
From: Grzegorz Jaskiewicz
Date:
Subject: Re: clang's static checker report.
Next
From: Grzegorz Jaskiewicz
Date:
Subject: Re: clang's static checker report.