Coverity analysis defect 76764: Macro compares unsigned to 0

XMLWordPrintableJSON

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

      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 (Inactive)
            Reporter:
            Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: