Invalid use of negative enumeration on type not declared as signed

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.5.1
    • Affects Version/s: None
    • Component/s: None
    • Linux
    • Hide

      Attempt to build on armhf.

      Show
      Attempt to build on armhf.
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      MinKey is defined as -1, so a signed char must be used to store BSONType
      enumerations. Using a char to store a negative value results in
      undefined behaviour. On i386 and amd64 architectures it happens to work
      because on these platforms a char is generally signed, but this is not
      guaranteed.

              Assignee:
              Andrew Morrow (Inactive)
              Reporter:
              Robie Basak
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: