Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7644: [-Wswitch] warnings with gcc 4.7.2 with C++11 enabled.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-11-21 18:30:55
#7644: [-Wswitch] warnings with gcc 4.7.2 with C++11 enabled.
-----------------------------------+----------------------------------------
Reporter: steven.lemay@⦠| Owner: johnmaddock
Type: Bugs | Status: new
Milestone: To Be Determined | Component: regex
Version: Boost 1.52.0 | Severity: Problem
Resolution: | Keywords: -Wswitch
-----------------------------------+----------------------------------------
Comment (by tvaneerd@â¦):
ie:
{{{
--- a/boost/regex/v4/cpp_regex_traits.hpp
+++ b/boost/regex/v4/cpp_regex_traits.hpp
@@ -112,7 +112,10 @@ parser_buf<charT, traits>::seekoff(off_type off,
::std::ios_base::seekdir way, :
std::ptrdiff_t size = this->egptr() - this->eback();
std::ptrdiff_t pos = this->gptr() - this->eback();
charT* g = this->eback();
- switch(way)
+
+ // cast to avoid gcc '-Wswitch',
+ // as ios_base::beg/cur/end are not necesssarily values of 'way' enum
type ios_base::seekdir
+ switch(static_cast<int>(way))
{
case ::std::ios_base::beg:
if((off < 0) || (off > size))}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7644#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:11 UTC