[xsd-users] gcc warning

Rizzuto, Raymond Raymond.Rizzuto at sig.com
Fri Oct 24 15:59:45 EDT 2008


I am working with an element that has an id defined this way:

                        <xs:attribute name="id" type="ReferenceDataId" use="required">
                        </xs:attribute>

ReferenceDataId is defined as:

            <xs:simpleType name="ReferenceDataId">
                        <xs:restriction base="xs:int"/>
            </xs:simpleType>

In one place in my code, I want to get the id out of a constructed object, and pass it to a function taking int.   I.e. essentially do this

   functionTakingAnInt(stock.get_id());

When I compile the code (gcc 3.3.3), I get this warning:

SDMPOrderState.cpp: In member function `void sdmp::OrderStateProcessor::handleNew(P<sdmp::SDMPSusexMsg>)':
SDMPOrderState.cpp:634: warning: choosing `xsd::cxx::tree::fundamental_base<T,    C, B, ST>::operator T&()
[with T = int_, C = char, B = xml_schema::simple_type, sd::cxx::tree::schema_type::value ST = other]'
over `xsd::cxx::tree::fundamental_base<T, C, B, ST>::operator const T&()    const
[with T = int_, C = char, B = xml_schema::simple_type,    xsd::cxx::tree::schema_type::value ST = other]'
SDMPOrderState.cpp:634: warning:   for conversion from `sdmp::messages::ReferenceDataId' to `int_'
SDMPOrderState.cpp:634: warning:   because conversion sequence for the argument is better

Is there a better method that prevents this warning?

Ray


________________________________
Ray Rizzuto
raymond.rizzuto at sig.com
Susquehanna International Group
(610)747-2336 (W)
(215)776-3780 (C)



________________________________
IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.



More information about the xsd-users mailing list