lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] more questions due to MSVC warnings


From: Greg Chicares
Subject: Re: [lmi] more questions due to MSVC warnings
Date: Sun, 30 Mar 2008 13:49:27 +0000
User-agent: Thunderbird 2.0.0.12 (Windows/20080213)

On 2008-03-28 23:31Z, Vadim Zeitlin wrote:
> On Fri, 28 Mar 2008 12:20:29 +0000 Greg Chicares <address@hidden> wrote:
> 
> GC> Consider this code in 'test_main.cpp':
> GC> 
> GC>     int result;
> GC> // GWC suppressed this because the borland compiler correcly warns
> GC> // that the initializing value is unused.
> GC> //    int result = 0;               // quiet compiler warnings
> GC> 
> GC>     try
> GC>         {
> GC>         result = test_main( argc, argv );
> GC> 
> GC> Would you leave that alone, or revert the change flagged with my
> GC> initials and zero-initialize the variable explicitly?
> 
>  Unfortunately there is really no good answer to this question. In wx we
> use wxDUMMY_INITIALIZE() macro which is defined differently for MSVC and
> BCC and can be used like this:
> 
>       int result wxDUMMY_INITIALIZE(0);
> 
> This allows to avoid the warnings with all compilers and also avoids the
> need to write the "quiet compiler warnings" comments. Obviously, it does
> this at the price of making the code more ugly.

On 20080330T1313Z I committed something with a similar purpose:

http://cvs.sv.gnu.org/viewvc/lmi/lmi/miscellany.hpp?r1=1.12&r2=1.13
http://cvs.sv.gnu.org/viewvc/lmi/lmi/test_main.cpp?r1=1.5&r2=1.6
http://cvs.sv.gnu.org/viewvc/lmi/lmi/value_cast_test.cpp?r1=1.16&r2=1.17

It obviates "quiet compiler warnings" comments, and works with
the three compilers I tested. Please let me know if you find any
problem with it.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]