Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-2574

Mismatch uint32_t / size_t generates many compile warnings, esp in 64-bit

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Auto Closed
    • 0.6
    • None
    • C++ Broker, C++ Client
    • None

    Description

      There are many places in the C++ code that mix uint32_t, usually in the form of an encoding or Buffer size, with size_t, usually the result of a size() call to a string or some other container. In a Windows 64-bit build this produces a warning for each occurrence similar to:

      3>C:\ace\exported\qpid\trunk\qpid\cpp\src\qpid/broker/Exchange.h(122) : warning C4267: 'return' : conversion from 'size_t' to 'uint32_t', possible loss of data

      This type of code is present in both hand-written and generated code, which is why I included the Code generator in the Components.

      Some can be removed with a cast - for example, the Uuid::encodedSize method isn't going to return a value greater than 2^32-1, so it can be safely cast away. But the problem should be dealt with more cleanly, I think.

      Attachments

        Activity

          People

            Unassigned Unassigned
            shuston Stephen D. Huston
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: