aburgett87 / googletest

Automatically exported from code.google.com/p/googletest
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

FormatTimeInMillisAsSeconds mixes floating-point and integer values #406

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In gtest-1.6.0, FormatTimeInMillisAsSeconds() divides an integer parameter 
("ms") by a floating-point constant (1000.0). This generates a warning under 
gcc-4.6.2.

* What steps will reproduce the problem?
1. Compile gtest-all.cc under gcc-4.6.2

* What is the expected output? What do you see instead?
I do not expect to see a warning. I do see a warning:

gtest-all.cc:4502:12: warning: conversion to 'double' from 
'testing::internal::TimeInMillis {aka long long int}' may alter its value 
[-Wconversion]

* What version of Google Test are you using? On what operating system?
gcc-4.6.2 under Ubuntu 10.04.

Original issue reported on code.google.com by mark.thu...@linguamatics.com on 6 Mar 2012 at 11:08

GoogleCodeExporter commented 9 years ago
This patch should fix the warning.

Original comment by dirk....@gmail.com on 23 Apr 2012 at 9:36

Attachments: