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

Sign of log severity values may get lost, depending on compiler

    • Fully Compatible
    • ALL
    • Platforms E (01/08/16)

      LogSeverity::Log().toInt() returns a possibly negative integer, which is cast into a char in several places, with the assumption that char's are signed by default. This assumption is not true for all platforms; GCC on ppc64 and s390x treats char's as unsigned by default. This causes the unit test server_options_test to fail on those platforms.

      The fix is to explicitly declare LogComponentSettings::_minimumLoggedSeverity as a signed char array.

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            bryanpkc Bryan Chan
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: