Re: [Boost-bugs] [Boost C++ Libraries] #1791: fix warning on MSVC warning level 4

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #1791: fix warning on MSVC warning level 4
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-06-10 15:56:22


#1791: fix warning on MSVC warning level 4
-------------------------------+--------------------------------------------
  Reporter: Stephan | Owner: nasonov
      Type: Patches | Status: new
 Milestone: To Be Determined | Component: lexical_cast
   Version: Boost 1.35.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+--------------------------------------------
Comment (by Stephan):

 Replying to [comment:1 nasonov]:
> As you may guess, the return statement was added to supress a warning.
>
> Can you please discusss possible workarounds on boost-devel? I don't
 have time, sorry.

 Sure: Here is what Paul came up with:
 {{{
 #if (defined _MSC_VER)
 # pragma warning( push )
 # pragma warning( disable : 4702 ) : unreachable code
 #endif

 throw_exception(bad_lexical_cast(typeid(Source), typeid(Target)));
 return Target(); // normally never reached (throw_exception)

 #if (defined _MSC_VER)
 # pragma warning( pop )
 #endif
 }}}

 which looks fine for me.

 Thanks,

 Stephan

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1791#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.


This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:58 UTC