Re: [Boost-bugs] [Boost C++ Libraries] #8405: VC++ 2012 compiler warning C4189: '...' : local variable is initialized but not referenced

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8405: VC++ 2012 compiler warning C4189: '...' : local variable is initialized but not referenced
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-04-05 20:55:54


#8405: VC++ 2012 compiler warning C4189: '...' : local variable is initialized but
not referenced
------------------------------------------------------+---------------------
  Reporter: Volker Schöch <vschoech@…> | Owner: barendgehrels
      Type: Support Requests | Status: new
 Milestone: To Be Determined | Component: geometry
   Version: Boost 1.52.0 | Severity: Not Applicable
Resolution: | Keywords: VC++ 2012, warning, C4189, local variable is initialized but not referenced
------------------------------------------------------+---------------------
Changes (by barendgehrels):

  * type: Bugs => Support Requests
  * severity: Problem => Not Applicable

Comment:

 The code is:

         int const n = int(section.range_count);
         return boost::is_same
                     <
                         typename tag_cast
                             <
                                 typename
 geometry::point_type<Geometry1>::type,
                                 areal_tag
>::type,
                         areal_tag
>::value
                && index1 == 0
                && index2 >= n - 2
                 ;


 As you can see the variable n '''is''' referenced.

 However, if is_same returns false, the variable is (at compiletime) indeed
 not referenced.

 This can be solved by using another (and more complex) construction, not
 by just removing n.

 This has currently no priority.

 The advice is to check with /W3.

 The same for fp_strategy, this strategy '''is''' used, be it sometimes
 only the static functions, but that is not known at that specific
 location.

 I change the classification from "Bug" to "Support Request"

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8405#comment:1>
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:50:12 UTC