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

Comparing the signed with the unsigned integer results in a compilation warning

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Environment:
      Ubuntu 20.04 on x86_64 CPU architecture
    • Fully Compatible
    • ALL
    • Hide

      Try to compile the crypto_test binary

      Show
      Try to compile the crypto_test binary

       It is not a big deal but should be better fixed:

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
       src/mongo/crypto/fle_crypto.cpp: In function 'mongo::BSONObj mongo::{anonymous}::toBSON(mongo::BSONType, mongo::ConstDataRange)':
      src/mongo/crypto/fle_crypto.cpp:1046:23: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
       1046 |             docLength < std::numeric_limits<int32_t>::max());
            |             ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      src/mongo/platform/compiler_gcc.h:91:80: note: in definition of macro 'MONGO_unlikely'
         91 | #define MONGO_unlikely(x) static_cast<bool>(__builtin_expect(static_cast<bool>(x), 0))
            |                                                                                ^
      src/mongo/util/assert_util.h:417:5: note: in expansion of macro 'MONGO_BASE_ASSERT'
        417 |     MONGO_BASE_ASSERT(::mongo::uassertedWithLocation, msgid, msg, expr)
            |     ^~~~~~~~~~~~~~~~~
      src/mongo/crypto/fle_crypto.cpp:1044:5: note: in expansion of macro 'uassert'
       1044 |     uassert(ErrorCodes::BadValue,
            |     ^~~~~~~
      

            Assignee:
            alex.neben@mongodb.com Alex Neben
            Reporter:
            konstantin.trushin@percona.com Konstantin Trushin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: