Qpid
  1. Qpid
  2. QPID-2574

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

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 0.6
    • Fix Version/s: None
    • Component/s: C++ Broker, C++ Client
    • Labels:
      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.

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Steve Huston
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development