Boost C++ Libraries: Ticket #4714: boost::tokenizer_detail::traits_extension does not expose correctly std::_Secure_char_traits_tag on VC9 https://svn.boost.org/trac10/ticket/4714 <p> This issues warning C4996: 'std::char_traits&lt;char&gt;::[various] ': Function call with parameters that may be unsafe because VC STL relies on a tag to chose the safe/unsafe version of the function. </p> <pre class="wiki"> typedef std::basic_string&lt;char&gt;::traits_type Tr; typedef boost::tokenizer_detail::traits_extension&lt;Tr&gt; Traits; cout &lt;&lt; typeid(std::_Char_traits_category_helper&lt;Tr,true&gt;::_Secure_char_traits).name() &lt;&lt; endl; cout &lt;&lt; typeid(std::_Char_traits_category_helper&lt;Traits,true&gt;::_Secure_char_traits).name() &lt;&lt; endl; </pre><p> prints </p> <pre class="wiki"> _Secure_char_traits_tag _Unsecure_char_traits_tag </pre><p> because _Char_traits_category_helper is defined as </p> <pre class="wiki">template &lt;class _Traits&gt; class _Char_traits_category_helper&lt;_Traits, true&gt; { public: typedef typename _Traits::_Secure_char_traits _Secure_char_traits; }; </pre><p> so it defers to a typedef of _Secure_char_traits inside the trait. By default it is defined to _Unsecure_char_traits_tag. </p> <p> This affects builds with /WX (treat warnings as errors) and generally causes a lot of warnings for otherwise harmless code (for example date_time relies on tokenizer to parse strings) </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4714 Trac 1.4.3 emilm@… Tue, 05 Oct 2010 12:53:49 GMT <link>https://svn.boost.org/trac10/ticket/4714#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4714#comment:1</guid> <description> <p> A possible fix would be to add this in the definition of traits_extension ( token_functions.hpp line 215 for boost 1_44) </p> <pre class="wiki">#if defined(BOOST_MSVC) &amp;&amp; defined(_SECURE_SCL) typedef typename std::_Char_traits_category&lt;traits&gt;::_Secure_char_traits _Secure_char_traits; #endif </pre> </description> <category>Ticket</category> </item> </channel> </rss>