Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-15183

Clang 3.5 reports error: fabs given long double when arg is double

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.8.0-rc0
    • Affects Version/s: 2.7.6
    • Component/s: Geo
    • None
    • Fully Compatible
    • ALL

      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.

            Assignee:
            siyuan.zhou@mongodb.com Siyuan Zhou
            Reporter:
            tyler@10gen.com Tyler Brock
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: