Boost C++ Libraries: Ticket #2643: Warning C4224 in reversible_ptr_container and hash https://svn.boost.org/trac10/ticket/2643 <p> I'm getting lots of warnings from reversible_ptr_container.hpp and has.hpp </p> <p> warning C4224: nonstandard extension used : formal parameter 'array' was previously defined as a type </p> <p> boost/functional/hash/hash.hpp formal parameter 'array' was previously defined as a type boost/ptr_container/detail/reversible_ptr_container.hpp C4224: nonstandard extension used : formal parameter 'hash' was previously defined as a type. </p> <p> Microsoft Visual Studio 2008 Version 9.0.21022.8 RTM (warning level 3 up) </p> <p> Choice of names seems to clash. If this is troublesome to change, it would be convenient to disable warnings for MSVC with push'n'pop as this generates a great pile of warning text. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2643 Trac 1.4.3 Daniel James Thu, 08 Jan 2009 10:31:46 GMT status changed https://svn.boost.org/trac10/ticket/2643#comment:1 https://svn.boost.org/trac10/ticket/2643#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> I can probably change the parameter name 'array', but it'd be really helpful if you could post a small example that triggers the warning, as I don't understand why it's a nonstandard extension. </p> <p> The warning in reversible_ptr_container.hpp will need to be fixed in the ptr_container library, so you should create a separate ticket for that. </p> Ticket Paul A. Bristow Thu, 08 Jan 2009 11:52:47 GMT <link>https://svn.boost.org/trac10/ticket/2643#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2643#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/2643#comment:1" title="Comment 1">danieljames</a>: </p> <blockquote class="citation"> <p> I can probably change the parameter name 'array', but it'd be really helpful if you could post a small example that triggers the warning, as I don't understand why it's a nonstandard extension. </p> </blockquote> <p> This comes from very deep within code, so I have no idea how to create a simple example. The complaint is </p> <p> "formal parameter 'array' was previously defined as a type." </p> <p> I suspect reusing the name is not allowed by the Standard? But compilers permit it. I recommend disabling the warning in this code unit if a name change looks dodgy. </p> <blockquote class="citation"> <p> The warning in reversible_ptr_container.hpp will need to be fixed in the ptr_container library, so you should create a separate ticket for that. </p> </blockquote> <p> I have created a new ticket for ptr_container <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2644" title="#2644: Bugs: Warnings C4224 from ptr_container (closed: fixed)">#2644</a> making a similar complaint. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Thu, 08 Jan 2009 13:25:31 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2643#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2643#comment:3</guid> <description> <p> Okay, I've looked into this (<a class="ext-link" href="http://msdn.microsoft.com/en-us/library/wh722488.aspx"><span class="icon">​</span>http://msdn.microsoft.com/en-us/library/wh722488.aspx</a>) and I wasn't getting a warning because I wasn't using the <code>/Za</code> flag. With it, I get the warning for: </p> <pre class="wiki">#include &lt;boost/array.hpp&gt; #include &lt;boost/functional/hash/hash.hpp&gt; int main() {} </pre><p> The warning seems dubious to me, but I'll change the parameter name. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Thu, 08 Jan 2009 13:37:35 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/2643#comment:4 https://svn.boost.org/trac10/ticket/2643#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</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/50514" title="Rename parameter to avoid Visual C++ warning about clash with ...">[50514]</a>) Rename parameter to avoid Visual C++ warning about clash with boost::array. </p> <p> Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2643" title="#2643: Bugs: Warning C4224 in reversible_ptr_container and hash (closed: fixed)">#2643</a> </p> Ticket Paul A. Bristow Thu, 08 Jan 2009 16:45:21 GMT <link>https://svn.boost.org/trac10/ticket/2643#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2643#comment:5</guid> <description> <p> Seems to do the trick for hash - Thanks. </p> <p> (but ptr_container still produces lots of warnings - see <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2644" title="#2644: Bugs: Warnings C4224 from ptr_container (closed: fixed)">#2644</a>) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Fri, 09 Jan 2009 23:12:16 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2643#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2643#comment:6</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/50528" title="Rename parameter to avoid Visual C++ warning about clash with ...">[50528]</a>) Rename parameter to avoid Visual C++ warning about clash with boost::array. </p> <p> Merged revisions 50514 via svnmerge from <a class="ext-link" href="https://svn.boost.org/svn/boost/trunk"><span class="icon">​</span>https://svn.boost.org/svn/boost/trunk</a> </p> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/50514" title="Rename parameter to avoid Visual C++ warning about clash with ...">r50514</a> | danieljames | 2009-01-08 13:37:33 +0000 (Thu, 08 Jan 2009) | 3 lines </p> </blockquote> <p> </p> <blockquote> <p> Rename parameter to avoid Visual C++ warning about clash with boost::array. </p> </blockquote> <p> </p> <blockquote> <p> Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2643" title="#2643: Bugs: Warning C4224 in reversible_ptr_container and hash (closed: fixed)">#2643</a> </p> </blockquote> <p> ........ </p> </description> <category>Ticket</category> </item> </channel> </rss>