[SERVER-15183] Clang 3.5 reports error: fabs given long double when arg is double Created: 09/Sep/14  Updated: 19/Nov/14  Resolved: 30/Oct/14

Status: Closed
Project: Core Server
Component/s: Geo
Affects Version/s: 2.7.6
Fix Version/s: 2.8.0-rc0

Type: Bug Priority: Major - P3
Reporter: Tyler Brock Assignee: Siyuan Zhou
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

Offending Code is in S2 library:

src/third_party/s2/util/math/mathutil.h:153:45: error: absolute value function 'fabs' given an argument of type 'long double' but has
      parameter of type 'double' which may cause truncation of value [-Werror,-Wabsolute-value]
    const double kTolerance = epsilon * max(fabs(2 * b * b), fabs(4 * a * c));

Recommendation is to use std::abs instead.



 Comments   
Comment by Githook User [ 19/Sep/14 ]

Author:

{u'username': u'TylerBrock', u'name': u'Tyler Brock', u'email': u'tyler.brock@gmail.com'}

Message: SERVER-15183 suppress warning about fabs value truncation
Branch: master
https://github.com/mongodb/mongo/commit/3fe2d4fb37cce8259991f7af8b58d67b357af84e

Generated at Thu Feb 08 03:37:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.