Boost C++ Libraries: Ticket #7644: [-Wswitch] warnings with gcc 4.7.2 with C++11 enabled. https://svn.boost.org/trac10/ticket/7644 <blockquote> <p> In file included from ./boost/regex/v4/regex_traits.hpp:39:0, </p> <blockquote> <p> from ./boost/regex/regex_traits.hpp:27, from ./boost/regex/v4/regex.hpp:39, from ./boost/regex.hpp:31, from libs\regex\build\..\src\winstances.cpp:30: </p> </blockquote> </blockquote> <p> ./boost/regex/v4/cpp_regex_traits.hpp: In instantiation of 'boost::re_detail::parser_buf&lt;charT, traits&gt;::pos_type boost::re_detail::parser_buf&lt;charT, traits&gt;::seekoff(boost::re_detail::parser_buf&lt;charT, traits&gt;::off_type, std::_Iosb&lt;int&gt;::seekdir, std::_Iosb&lt;int&gt;::openmode) [with charT = wchar_t; traits = std::char_traits&lt;wchar_t&gt;; boost::re_detail::parser_buf&lt;charT, traits&gt;::pos_type = std::fpos&lt;_Mbstatet&gt;; boost::re_detail::parser_buf&lt;charT, traits&gt;::off_type = long int; std::_Iosb&lt;int&gt;::seekdir = std::_Iosb&lt;int&gt;::_Seekdir; std::_Iosb&lt;int&gt;::openmode = std::_Iosb&lt;int&gt;::_Openmode]': ./boost/regex/v4/regex_split.hpp:168:1: required from here ./boost/regex/v4/cpp_regex_traits.hpp:117:4: warning: case value '0' not in enumerated type 'std::_Iosb&lt;int&gt;::seekdir {aka std::_Iosb&lt;int&gt;::_Seekdir}' [-Wswitch] ./boost/regex/v4/cpp_regex_traits.hpp:129:4: warning: case value '1' not in enumerated type 'std::_Iosb&lt;int&gt;::seekdir {aka std::_Iosb&lt;int&gt;::_Seekdir}' [-Wswitch] ./boost/regex/v4/cpp_regex_traits.hpp:123:4: warning: case value '2' not in enumerated type 'std::_Iosb&lt;int&gt;::seekdir {aka std::_Iosb&lt;int&gt;::_Seekdir}' [-Wswitch] </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7644 Trac 1.4.3 tvaneerd@… Wed, 21 Nov 2012 18:30:55 GMT <link>https://svn.boost.org/trac10/ticket/7644#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7644#comment:1</guid> <description> <p> ie: </p> <pre class="wiki">--- a/boost/regex/v4/cpp_regex_traits.hpp +++ b/boost/regex/v4/cpp_regex_traits.hpp @@ -112,7 +112,10 @@ parser_buf&lt;charT, traits&gt;::seekoff(off_type off, ::std::ios_base::seekdir way, : std::ptrdiff_t size = this-&gt;egptr() - this-&gt;eback(); std::ptrdiff_t pos = this-&gt;gptr() - this-&gt;eback(); charT* g = this-&gt;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&lt;int&gt;(way)) { case ::std::ios_base::beg: if((off &lt; 0) || (off &gt; size))}}} </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Thu, 29 Nov 2012 10:28:17 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7644#comment:2 https://svn.boost.org/trac10/ticket/7644#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/81620" title="Suppress GCC warning and update History log. Regenerate docs. Fixes #7644.">[81620]</a>) Suppress GCC warning and update History log. Regenerate docs. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7644" title="#7644: Bugs: [-Wswitch] warnings with gcc 4.7.2 with C++11 enabled. (closed: fixed)">#7644</a>. </p> Ticket