Coverity analysis defect 105024: Macro compares unsigned to 0

XMLWordPrintableJSON

    • Fully Compatible
    • ALL
    • Security 2018-10-08
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      An unsigned value can never be less than 0

      Defect 105024 (STATIC_C)
      Checker NO_EFFECT (subcategory unsigned_compare_macros)
      File: /src/mongo/transport/service_executor_reserved.cpp
      Function mongo::transport::ServiceExecutorReserved::_startWorker()::[lambda() (instance 1)]::operator ()() const::[lambda() (instance 1)]::operator ()() const
      /src/mongo/transport/service_executor_reserved.cpp, line: 90
      This greater-than-or-equal-to-zero comparison of an unsigned value is always true. "this->__coverity_captured_this->_numRunningWorkerThreads.subtractAndFetch(1U) >= 0U".

                      invariant(_numRunningWorkerThreads.subtractAndFetch(1) >= 0);
      

            Assignee:
            Jonathan Reams
            Reporter:
            Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: