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

                 Key: QPID-2574
                 URL: https://issues.apache.org/jira/browse/QPID-2574
             Project: Qpid
          Issue Type: Bug
          Components: C++ Broker, C++ Client, Code Generator
    Affects Versions: 0.6
            Reporter: Steve Huston
            Priority: Minor


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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to