Boost C++ Libraries: Ticket #9271: C4512 warnings with VS 2013 RTM https://svn.boost.org/trac10/ticket/9271 <p> Some conversions (e.g. std::string to float) result in a warning on the newest VS version. This are the warnings I'm getting while compiling a bigger project with the currect boost trunk version: </p> <p> boost/lexical_cast.hpp(726): warning C4512: 'boost::detail::lcast_put_unsigned&lt;Traits,utype,CharT&gt;' : assignment operator could not be generated boost/lexical_cast.hpp(862): warning C4512: 'boost::detail::lcast_ret_unsigned&lt;Traits,Type,CharT&gt;' : assignment operator could not be generated boost/lexical_cast.hpp(1984): warning C4512: 'boost::detail::lexical_ostream_limited_src&lt;char,std::char_traits&lt;char&gt;&gt;' : assignment operator could not be generated </p> <p> This classes (and possibly more) should have a deleted/private assignment operator or disable this warning altogether. Hopefully this can be fixed before the 1.55 release. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9271 Trac 1.4.3 Antony Polukhin Sun, 20 Oct 2013 17:57:16 GMT <link>https://svn.boost.org/trac10/ticket/9271#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9271#comment:1</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/86374" title="Supressing MSVC2013 warnings and ensuring that lexical cast io classes ...">[86374]</a>) Supressing MSVC2013 warnings and ensuring that lexical cast io classes are not copied (refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9271" title="#9271: Bugs: C4512 warnings with VS 2013 RTM (closed: fixed)">#9271</a>) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Sun, 20 Oct 2013 18:03:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9271#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9271#comment:2</guid> <description> <p> Thanks for reporting the issue! Could you please make some tests now? Are the warnings still there? </p> <p> BTW, those classes do not exist in 1.55 (trunk has a big set of changes that were not merged to 1.55 release), so there is no need to worry about merging changes to 1.55 </p> </description> <category>Ticket</category> </item> <item> <author>sebi707@…</author> <pubDate>Sun, 20 Oct 2013 19:19:55 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9271#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9271#comment:3</guid> <description> <p> Thanks! This removed those warnings but I'm still getting warnings in another file. I'm not sure if this belongs to the lexical_cast component but if I convert the compoments of a boost::smatch to int using lexical_cast I get these warnings: </p> <pre class="wiki">boost/detail/basic_pointerbuf.hpp(54): warning C4505: 'boost::detail::basic_pointerbuf&lt;CharT,BufferType&gt;::setbuf' : unreferenced local function has been removed boost/detail/basic_pointerbuf.hpp(55): warning C4505: 'boost::detail::basic_pointerbuf&lt;CharT,BufferType&gt;::seekpos' : unreferenced local function has been removed boost/detail/basic_pointerbuf.hpp(56): warning C4505: 'boost::detail::basic_pointerbuf&lt;CharT,BufferType&gt;::seekoff' : unreferenced local function has been removed </pre><p> I guess these warnings are not really VS 2013 specific as the previous reported warnings also occur with VS 2010 if you compile with warning level 4. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Mon, 21 Oct 2013 06:46:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9271#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9271#comment:4</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/86377" title="Suppress some of the Level 4 MSVC warnings in the basic_pointerbuf.hpp ...">[86377]</a>) Suppress some of the Level 4 MSVC warnings in the basic_pointerbuf.hpp (refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9271" title="#9271: Bugs: C4512 warnings with VS 2013 RTM (closed: fixed)">#9271</a>) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Mon, 21 Oct 2013 06:50:57 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9271#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9271#comment:5</guid> <description> <p> Could you please make some tests now? Are the warnings still there? Maybe there are some warnings in other libraries? (Unfortunately I do not have access to the MSVC2013 compiler) </p> </description> <category>Ticket</category> </item> <item> <author>raad@…</author> <pubDate>Mon, 21 Oct 2013 08:29:55 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9271#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9271#comment:6</guid> <description> <p> In <a class="changeset" href="https://svn.boost.org/trac10/changeset/86377" title="Suppress some of the Level 4 MSVC warnings in the basic_pointerbuf.hpp ...">r86377</a>, there is a #pragma warning(pop) without a matching #pragma warning(push) before the #pragma warning(disable: 4505). This leaves the warning disabled. Additionally, this leads to a new warning "C4193: #pragma warning(pop) : no matching '#pragma warning(push)'". </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Mon, 21 Oct 2013 09:21:37 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9271#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9271#comment:7</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/86378" title="Add missing #pragma wraning(push) (refs #9271)">[86378]</a>) Add missing #pragma wraning(push) (refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9271" title="#9271: Bugs: C4512 warnings with VS 2013 RTM (closed: fixed)">#9271</a>) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Mon, 21 Oct 2013 09:25:09 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9271#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9271#comment:8</guid> <description> <p> Hope I forget nothing... Is it OK now? </p> </description> <category>Ticket</category> </item> <item> <author>raad@…</author> <pubDate>Mon, 21 Oct 2013 09:31:18 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9271#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9271#comment:9</guid> <description> <p> Works for me now, thank you! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Mon, 21 Oct 2013 09:32:35 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9271#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9271#comment:10</guid> <description> <p> Thank you for reporting this bug! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Mon, 21 Oct 2013 09:32:55 GMT</pubDate> <title>status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/9271#comment:11 https://svn.boost.org/trac10/ticket/9271#comment:11 <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> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.56.0</span> </li> </ul> Ticket sebi707@… Mon, 21 Oct 2013 12:05:33 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/9271#comment:12 https://svn.boost.org/trac10/ticket/9271#comment:12 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> Unfortunatly this didn't fix the warning for me. It seems that you cannot disable it by just wrapping the class with #pragma warning. The warning has to be disabled for the whole compilation unit. Here you can find some more informations: <a class="ext-link" href="http://stackoverflow.com/questions/3051992/compiler-warning-at-c-template-base-class"><span class="icon">​</span>http://stackoverflow.com/questions/3051992/compiler-warning-at-c-template-base-class</a> </p> <p> I'm not sure what would be the best way to get rid of the warning. Declaring the functions as inline seems to work but it's not really a nice solution. </p> Ticket Antony Polukhin Tue, 22 Oct 2013 09:07:03 GMT <link>https://svn.boost.org/trac10/ticket/9271#comment:13 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9271#comment:13</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/86388" title="Another attempt to suppress MSVC warnings (refs #9271)">[86388]</a>) Another attempt to suppress MSVC warnings (refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9271" title="#9271: Bugs: C4512 warnings with VS 2013 RTM (closed: fixed)">#9271</a>) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Tue, 22 Oct 2013 09:10:44 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9271#comment:14 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9271#comment:14</guid> <description> <p> GCC and Clang give no warning about adding an inline hint for virtual functions. Did it help to suppress MSVC warning? </p> </description> <category>Ticket</category> </item> <item> <author>sebi707@…</author> <pubDate>Tue, 22 Oct 2013 09:58:11 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9271#comment:15 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9271#comment:15</guid> <description> <p> Yes thanks! All the warnings are gone now. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Tue, 12 Nov 2013 17:15:13 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9271#comment:16 https://svn.boost.org/trac10/ticket/9271#comment:16 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</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/86654" title="Merged a big bunch of internal code changes from trunk for ...">[86654]</a>) Merged a big bunch of internal code changes from trunk for lexical_cast: dropped support of antique compilers, code changed to produce a smaller binaries and simplify compiler's work, simplified and shortened the code, common with other libraries code moved to 'detail/basic_pointerbuf.hpp' (fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9046" title="#9046: Tasks: Refactoring of lexical cast (closed: fixed)">#9046</a>, fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9070" title="#9070: Bugs: Boost.LexicalCast wrong parameter name (closed: fixed)">#9070</a>, fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9271" title="#9271: Bugs: C4512 warnings with VS 2013 RTM (closed: fixed)">#9271</a>) </p> Ticket