[SERVER-7273] documenttests.cpp:808 warning about int64->double truncation Created: 05/Oct/12 Updated: 11/Jul/16 Resolved: 11/Oct/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Testing Infrastructure |
| Affects Version/s: | 2.3.0 |
| Fix Version/s: | 2.3.0 |
| Type: | Bug | Priority: | Trivial - P5 |
| Reporter: | Andy Schwerin | Assignee: | Aaron Staple |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Participants: |
| Description |
|
The MSVC compiler emits a warning about precision loss when converting int64_t(0x8fffffffffffffffLL) to a double. We'd like our compiles to be warning-free. The correct solution here is probably to suppress the warning on Windows, since we're intentionally trying to lose precision for this test. |
| Comments |
| Comment by auto [ 11/Oct/12 ] |
|
Author: {u'date': u'2012-10-10T16:59:13-07:00', u'email': u'aaron@10gen.com', u'name': u'Aaron'}Message: |
| Comment by auto [ 10/Oct/12 ] |
|
Author: {u'date': u'2012-10-07T20:49:14-07:00', u'email': u'aaron@10gen.com', u'name': u'Aaron'}Message: |
| Comment by Aaron Staple [ 10/Oct/12 ] |
|
<http://buildbot.mongodb.org/builders/Windows%2064-bit/builds/5071/steps/compile/logs/stdio> |
| Comment by Tad Marshall [ 05/Oct/12 ] |
|
I think that static_cast<double>( 0x8fffffffffffffffLL ) would make the warning go away without "suppressing" it. The warning is telling you that you didn't explicitly make this conversion yourself and maybe you weren't expecting to lose precision. If you static_cast it yourself, the compiler knows that this is on purpose. |