You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Steve Huston <sh...@riverace.com> on 2013/01/24 01:26:20 UTC

FYI - compile warning in Variant.cpp on Windows Visual Studio

The following warning is currently seen when building C++ Qpid in Release mode on Windows (all of Visual Studio 2012, 2010, 2008):

Compiling...
Variant.cpp

..\..\qpid\cpp\src\qpid\types\Variant.cpp(125) : warning C4146: unary minus operator applied to unsigned type, result still unsigned

        ..\..\qpid\cpp\src\qpid\types\Variant.cpp(328) : see reference to function template instantiation 'T qpid::types::VariantImpl::convertFromString<uint32_t>(void) const' being compiled
        with
        [
            T=uint32_t
        ]

There's a similar warning for uint64_t.

The warning is not issued when compiled in Debug mode. The code runs correctly in both modes. This appears to be a problem with Visual Studio C++ - I reported it to Microsoft.

FYI...

-Steve

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: FYI - compile warning in Variant.cpp on Windows Visual Studio

Posted by Andrew Stitcher <as...@redhat.com>.
On Thu, 2013-01-24 at 00:26 +0000, Steve Huston wrote:
> The following warning is currently seen when building C++ Qpid in Release mode on Windows (all of Visual Studio 2012, 2010, 2008):
> 
> Compiling...
> Variant.cpp
> 
> ..\..\qpid\cpp\src\qpid\types\Variant.cpp(125) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
> 
>         ..\..\qpid\cpp\src\qpid\types\Variant.cpp(328) : see reference to function template instantiation 'T qpid::types::VariantImpl::convertFromString<uint32_t>(void) const' being compiled
>         with
>         [
>             T=uint32_t
>         ]
> 
> There's a similar warning for uint64_t.
> 
> The warning is not issued when compiled in Debug mode. The code runs correctly in both modes. This appears to be a problem with Visual Studio C++ - I reported it to Microsoft.
> 
> FYI...

This is due to a recent bug fix. The compiler should be able to tell
that branch of the if can never happen because of a compile time
constant (in other words that unary minus can only happen if the type is
signed).

Andrew



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org