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

Investigate MSVC warning in GeoHashConverter code

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Geo
    • Labels:
      None
    • Operating System:
      ALL

      Description

      The sizeEdge function triggered a warning in MSVC. It needs to be investigated to verify if the code warning should be ignored. The code was introduced in SERVER-15576.

      // Relative error = epsilon_(max-min). ldexp() is just a direct translation to
      // floating point exponent, and should be exact.
      double GeoHashConverter::sizeEdge(unsigned level) const {
          invariant(level >= 0);
          invariant((int)level <= _params.bits);
      #pragma warning(push) 
      // C4146: unary minus operator applied to unsigned type, result still unsigned
      #pragma warning(disable : 4146)
          return ldexp(_params.max - _params.min, -level);
      #pragma warning(pop)
      }
      

        Attachments

          Activity

            People

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            mark.benvenuto Mark Benvenuto
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: