Boost C++ Libraries: Ticket #3485: Boost 1.40 Example.cpp program produces pages of MSVC level 1 warning 4180 https://svn.boost.org/trac10/ticket/3485 <p> Compiling... Getting started example.cpp example.cpp I:\boost_trunk\boost/lambda/detail/lambda_functors.hpp(140) : warning C4180: qualifier applied to function type has no meaning; ignored </p> <blockquote> <p> I:\boost_trunk\boost/lambda/detail/lambda_functor_base.hpp(172) : see reference to class template instantiation 'boost::lambda::lambda_functor&lt;T&gt;' being compiled with [ </p> <blockquote> <p> T=boost::lambda::identity&lt;const int&gt; </p> </blockquote> <p> ] </p> </blockquote> <p> ... </p> <blockquote> <p> with [ </p> <blockquote> <p> T=boost::lambda::lambda_functor_base&lt;boost::lambda::arithmetic_action&lt;boost::lambda::multiply_action&gt;,boost::tuples::tuple&lt;boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;1&gt;&gt;,const int,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type&gt;&gt; </p> </blockquote> </blockquote> <p> This is harmless but doesn't get newbies off to an encouraging start! </p> <p> I would be *much* nicer to have this warning (MSVC level 1) removed or quieted in lambda. </p> <p> But it is not obvious to me how to do this - adding disable for the existing warning supression does not quiet the warning. </p> <p> #pragma warning (disable : 4180) as the first line does work. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3485 Trac 1.4.3 Paul A. Bristow Fri, 25 Sep 2009 08:23:20 GMT <link>https://svn.boost.org/trac10/ticket/3485#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3485#comment:1</guid> <description> <p> Has been fixed already. Sorry for noise - I was muddled the include order - again :-( </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Sun, 27 Sep 2009 02:17:30 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3485#comment:2 https://svn.boost.org/trac10/ticket/3485#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">invalid</span> </li> </ul> Ticket Paul A. Bristow Wed, 04 Nov 2009 11:26:34 GMT status, version, milestone changed; resolution deleted https://svn.boost.org/trac10/ticket/3485#comment:3 https://svn.boost.org/trac10/ticket/3485#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.40.0</span> → <span class="trac-field-new">Boost Release Branch</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">invalid</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.41.0</span> → <span class="trac-field-new">Boost 1.42.0</span> </li> </ul> <p> I've noticed in passing that at 1_41_1_beta that example.cpp is still producing two pages of warnings for this example. </p> <p> I think that in lambda_functors.hpp, it needs adding a </p> <p> #pragma warning(disable:4180) <em> qualifier applied to function type has no meaning; </em></p> <p> thus: </p> <p> #if BOOST_WORKAROUND(BOOST_MSVC, &gt;= 1400) #pragma warning(push) #pragma warning(disable:4512) <em>assignment operator could not be generated #pragma warning(disable:4180) </em> qualifier applied to function type has no meaning; ignored #endif </p> <p> Sorry for my continued muddle :-( </p> <p> (Note: Version box does not yet include 1.41) </p> Ticket Steven Watanabe Wed, 04 Nov 2009 15:36:35 GMT <link>https://svn.boost.org/trac10/ticket/3485#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3485#comment:4</guid> <description> <p> The example compiles without warnings for me in both the trunk and release branches with msvc 8.0 and 9.0 /W4. I haven't checked the beta yet, although I would expect it to be the same as the release branch. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Wed, 04 Nov 2009 15:47:53 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3485#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3485#comment:5</guid> <description> <p> The beta appears to be okay too, even using the IDE instead of bjam to build. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Paul A. Bristow</dc:creator> <pubDate>Wed, 04 Nov 2009 18:40:35 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3485#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3485#comment:6</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/3485#comment:5" title="Comment 5">steven_watanabe</a>: </p> <blockquote class="citation"> <p> The beta appears to be okay too, even using the IDE instead of bjam to build. </p> </blockquote> <p> This is bizarre. I have also reported some similar 4180 warnings in boost::math which John could not reproduce despite having a test .cpp program from me. </p> <p> But I have just tried again enabling MS extensions = no and the warnings disappear. </p> <p> So disabling MS extensions = Yes (/Za) provokes the warnings! </p> <p> But John has removing the complained-about const s (from trunk) and my test now compiles free of warnings from boost::math - but with some still from Fusion. </p> <p> I am unclear if the addition of const to a function is actually prohibited by the C++ Standard, and indeed why const has been added by Joel and John - who are not novices ;-) </p> <p> So I feel that removing the consts is preferred but disabling the warning would be second best. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Wed, 04 Nov 2009 23:56:05 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3485#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3485#comment:7</guid> <description> <p> Okay. I've duplicated the problem. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Sun, 08 Nov 2009 04:11:22 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3485#comment:8 https://svn.boost.org/trac10/ticket/3485#comment:8 <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/57479" title="Deal with warnings with /Za. Fixes #3485">[57479]</a>) Deal with warnings with /Za. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3485" title="#3485: Bugs: Boost 1.40 Example.cpp program produces pages of MSVC level 1 warning 4180 (closed: fixed)">#3485</a> </p> Ticket