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

Coverity analysis defect 76764: Macro compares unsigned to 0

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.11
    • Affects Version/s: None
    • Component/s: Internal Code
    • Fully Compatible
    • ALL
    • Platforms 18 (08/05/16)

      An unsigned value can never be less than 0

      Defect 76764 (STATIC_C)
      Checker NO_EFFECT (subcategory unsigned_compare_macros)
      File: /src/mongo/util/itoa.cpp
      Function mongo::ItoA::ItoA(unsigned int)
      /src/mongo/util/itoa.cpp, line: 1060
      This greater-than-or-equal-to-zero comparison of an unsigned value is always true. "pos >= 0UL".

                  invariant(pos >= 0);
      

            Assignee:
            waley.chen Waley Chen
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: