[SERVER-48079] implicit conversion from 'long long' to 'double' in summation.cpp Created: 11/May/20  Updated: 29/Oct/23  Resolved: 19/Aug/21

Status: Closed
Project: Core Server
Component/s: Security
Affects Version/s: None
Fix Version/s: 5.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Jiang Li Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-59233 Fix or suppress warnings when buildin... Closed
Related
related to SERVER-57633 Remove disable warnings as error for ... Closed
is related to SERVER-46071 Server parameters with AtomicWord<int... Closed
is related to SERVER-48076 implicit conversion from 'long long' ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

Compile with clang-10

Sprint: Execution Team 2021-08-23
Participants:

 Description   

src/mongo/util/summation.cpp:55:40: error: implicit conversion from 'long long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Werror,-Wimplicit-int-float-conversion]
 
if (_sum > limits::min() && _sum < limits::max())
 
                                                       ~ ^~~~~~~~~~~~~
 
 
 
src/mongo/util/summation.cpp:64:17: error: implicit conversion from 'long long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Werror,-Wimplicit-int-float-conversion]
 if (_sum == limits::max())
 
              ~~ ^~~~~~~~~~~~~
 
 
 
src/mongo/util/summation.cpp:81:17: error: implicit conversion from 'long long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Werror,-Wimplicit-int-float-conversion]
 
if (_sum == std::numeric_limits<long long>::max()) {
 
              ~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 19/Aug/21 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-57633 SERVER-48079 fix implicit long long to double conversion in summation.cpp
Branch: master
https://github.com/mongodb/mongo/commit/11c215d484165aa465bd16fbf8e0379d5f30aec0

Generated at Thu Feb 08 05:16:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.