Re: pgbench stats per script & other stuff - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: pgbench stats per script & other stuff
Date
Msg-id alpine.DEB.2.10.1512151237030.25544@sto
Whole thread Raw
In response to Re: pgbench stats per script & other stuff  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: pgbench stats per script & other stuff  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
>> "sum" is a double so count is converted to 0.0, 0.0/0.0 == NaN, hence the
>> comment.
>
> PG code usually avoids that, and I recall static analyze tools type
> coverity complaining that this may lead to undefined behavior. While I
> agree that this would lead to NaN...

Hmmm. In this case that is what is actually wanted. If there is no 
transaction, the tps or average latency or whatever is "NaN", I cannot 
help it, and IEEE 754 allow that. So in this case the tool is wrong if it 
complains, or at least we are right to ignore the warning. Maybe there is 
some special comment to say "ignore this warning on the next line" if it 
occurs, if this is an issue.

-- 
Fabien.



pgsql-hackers by date:

Previous
From: Andreas Karlsson
Date:
Subject: Check for interrupts in bf and xdes crypt()
Next
From: Artur Zakirov
Date:
Subject: Re: Allow replication roles to use file access functions