Boost C++ Libraries: Ticket #6973: BOOST_PP_LIMIT_REPEAT does not work on Visual Studio 2008/2010 https://svn.boost.org/trac10/ticket/6973 <p> If you attempt to using BOOST_PP_ENUM or BOOST_PP_REPEAT up to BOOST_PP_LIMIT_REPEAT on Visual Studio 2008 or 2010, compilation fails with the following error: </p> <p> fatal error C1009: compiler limit : macros nested too deeply </p> <p> A duplication program is attached. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6973 Trac 1.4.3 Jonathan Jones <jonathan.jones@…> Fri, 08 Jun 2012 20:38:04 GMT attachment set https://svn.boost.org/trac10/ticket/6973 https://svn.boost.org/trac10/ticket/6973 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">limit_repeat.cpp</span> </li> </ul> Ticket Edward Diener Sun, 17 May 2015 03:15:41 GMT <link>https://svn.boost.org/trac10/ticket/6973#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6973#comment:1</guid> <description> <p> This is a compiler limitation. I do not think the preprocessor library can do anything about it. Any suggestions ? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Edward Diener</dc:creator> <pubDate>Mon, 18 May 2015 06:37:12 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6973#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6973#comment:2</guid> <description> <p> I am going to close this ticket as it is really a VC++ problem. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Edward Diener</dc:creator> <pubDate>Mon, 18 May 2015 06:37:21 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/6973#comment:3 https://svn.boost.org/trac10/ticket/6973#comment:3 <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> Ticket Jonathan Jones <jonathan.jones@…> Mon, 18 May 2015 14:14:33 GMT <link>https://svn.boost.org/trac10/ticket/6973#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6973#comment:4</guid> <description> <p> I still think there is a Boost bug here. The limit chosen for the compiler doesn't work. </p> <p> At a minimum, it seems like BOOST_PP_LIMIT_REPEAT should be lowered for VS2008/VS2010 to something that actually works. </p> <p> Also, it would be helpful to know if the current BOOST_PP_LIMIT_REPEAT actually works for VS2012/VS2013. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Edward Diener</dc:creator> <pubDate>Mon, 18 May 2015 15:07:21 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6973#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6973#comment:5</guid> <description> <p> You are asking for the various limits to be different depending on the compiler and its version. I don't think this is desirable. Even determining at what point a compiler limit has been reached for any given Boost PP processing is an indeterminate thing. </p> <p> I understand your problem, but it is a compiler problem not a Boost PP problem. Boost PP does go out of its way to work with the vagaries of different compilers, VC++ being among them since its preprocessor is heavily non-standard and as you have found it has further limitations, but trying to "fix" VC++ in this area is impossible. </p> </description> <category>Ticket</category> </item> <item> <author>Jonathan Jones <jonathan.jones@…></author> <pubDate>Tue, 19 May 2015 18:20:40 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6973#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6973#comment:6</guid> <description> <p> It seems that this is still broken with VS2013. I still think there is an issue that needs to be addressed in Boost to work around the compiler limitation. </p> <p> Using BOOST_PP_LIMIT_REPEAT, as the documentation says it should work, fails. </p> </description> <category>Ticket</category> </item> <item> <author>dave.lowell@…</author> <pubDate>Thu, 21 May 2015 14:03:05 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/6973#comment:7 https://svn.boost.org/trac10/ticket/6973#comment:7 <ul> <li><strong>cc</strong> <span class="trac-author">dave.lowell@…</span> added </li> </ul> Ticket Edward Diener Sat, 30 May 2015 04:15:53 GMT <link>https://svn.boost.org/trac10/ticket/6973#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6973#comment:8</guid> <description> <p> My tests show for VC++ that in your limit_repeat.cpp test for BOOST_PP_ENUM a count of 230 is the maximum to avoid the C1009 message and that for BOOST_PP_REPEAT a count of 252 is the maximum to avoid the C1009 message. Other Boost preprocessor repetition macros may have other limits with VC++, but as you can see there is no predetermined way that the code can know what the VC++ limit is for any given macro. </p> <p> I have added an explanation of the VC++ limitation in this regard to the documentation of the BOOST_PP_LIMIT_REPEAT macro on the 'develop' branch. </p> <p> Other compilers such as gcc also display limitations when dealing with seqs that are as large as 256 elements. In gcc's case I have encountered an occasional "out of memory" error coming from the compiler when Boost PP seq macros were invoked on such a large seq. </p> <p> While the Boost preprocessor library correctly works with seqs that are as large as 256 elements as far as preprocessor macro programming is concerned compiler limitations often make it unrealistic to work with such large seqs in preprocessor code. </p> </description> <category>Ticket</category> </item> </channel> </rss>