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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.7.6
    • Fix Version/s: 2.8.0-rc0
    • Component/s: Geo
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL

      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.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: