Boost C++ Libraries: Ticket #10686: Boost.Preprocessor VARIADICS and VARIADICS_MSVC defined incorrectly under MSVC12 https://svn.boost.org/trac10/ticket/10686 <p> In boost/preprocessor/config.hpp:line81 there is a check whether <code>__EDG__</code> is defined or not. If it isn't, and the version of MSVC is higher than 1400, the macros <code>BOOST_PP_VARIADICS</code> and <code>BOOST_PP_VARIADICS_MSVC</code> are defined to be 1. </p> <p> But, with <a class="missing wiki">VisualStudio</a> 2013 and MSVC12, <code>__EDG__</code> is defined to be 1, which of course breaks this part of the header, rendering variadic macros unusable. </p> <p> The workaround is of course to define both <code>BOOST_PP_VARIADICS</code> and <code>BOOST_PP_VARIADICS_MSVC</code> before including any Boost.Preprocessor related files. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10686 Trac 1.4.3 Edward Diener Thu, 30 Oct 2014 20:19:23 GMT <link>https://svn.boost.org/trac10/ticket/10686#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10686#comment:1</guid> <description> <p> I do not see in what situation <span class="underline">EDG</span> is defined in VC++12. Would you please supply a command line which generates that define ? Furthermore it is not listed in the documentation as a predefined macro. </p> </description> <category>Ticket</category> </item> <item> <author>raad@…</author> <pubDate>Thu, 30 Oct 2014 22:38:57 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/10686#comment:2 https://svn.boost.org/trac10/ticket/10686#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">raad@…</span> added </li> </ul> Ticket iFreilicht Tue, 04 Nov 2014 14:53:09 GMT <link>https://svn.boost.org/trac10/ticket/10686#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10686#comment:3</guid> <description> <p> That is correct, it is not documented. </p> <p> I'm sorry, I'm only talking about <a class="missing wiki">VisualStudio</a> 2013 and VC++ 2013. From my knowledge it has the version number 12, that's why I called it that. </p> <p> I have made a minimal case and it seems like <code>__EDG__</code> is only defined under the <a class="missing wiki">IntelliSense</a> compiler for what ever reason. </p> <pre class="wiki">#if __EDG__ #error __EDG__ is defined #endif </pre><p> This code will throw no error upon compilation, but <a class="missing wiki">IntelliSense</a> shows it as getting reached and <code>__EDG__</code> as being defined. Thus, compilation behaviour is not touched by this bug. </p> <p> Also, after taking a closer look at preprocessor/config.hpp, there seems to be awareness for this. </p> <p> In lines 34-39, it is first checked if <code>__EDG__</code> is defined and then <code>_MSC_VER</code>. If they both are, the MSVC config flags are set as the result of <code>BOOST_PP_CONFIG_FLAGS</code>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Edward Diener</dc:creator> <pubDate>Thu, 06 Nov 2014 14:41:10 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10686#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10686#comment:4</guid> <description> <p> VC++12 is the C++ version under Visual Studio 2013. </p> <p> What does it mean when you say <span class="underline">_EDG</span>_ is only defined under the Intellisense compiler ? Is there a 'cl' compiler switch which you can show which defines <span class="underline">_EDG</span>_ ? </p> <p> The definition of: </p> <pre class="wiki"># define BOOST_PP_VARIADICS_MSVC 1 </pre><p> is only made for the VC++ preprocessor when variadic macros are allowed. This means lots of workarounds for VC++ in the Boost PP code because VC++ does not have a standard C++ preprocessor. However if <span class="underline">_EDG</span>_ is defined Boost PP assumes a C++ standard conforming preprocessor and the VC++ workarounds are not used in that case. If Microsoft is defining <span class="underline">_EDG</span>_ in any situation I would like to understand the case because in terms of Boost PP this means a C++ conforming preprocessor and if that is not the case when <span class="underline">_EDG</span>_ is defined I have to find a workaround in Boost PP for that situation. </p> <p> If <span class="underline">_EDG</span>_ is defined BOOST_PP_VARIADICS is set to 1 via the lines in config.h of: </p> <pre class="wiki"># elif !defined __cplusplus &amp;&amp; __STDC_VERSION__ &gt;= 199901L || __cplusplus &gt;= 201103L # define BOOST_PP_VARIADICS 1 </pre><p> so BOOST_PP_VARIADICS will be defined if Microsoft is defining <span class="underline">_EDG</span>_ anywhere, but no workarounds for VC++'s broken preprocessor are then used. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>iFreilicht</dc:creator> <pubDate>Sun, 09 Nov 2014 00:18:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10686#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10686#comment:5</guid> <description> <p> I mean it as I say it. To cite this article: <a class="ext-link" href="http://blogs.msdn.com/b/vcblog/archive/2011/03/29/10146895.aspx"><span class="icon">​</span>http://blogs.msdn.com/b/vcblog/archive/2011/03/29/10146895.aspx</a> </p> <p> "The <a class="missing wiki">IntelliSense</a> compiler is not the build compiler." </p> <p> <a class="missing wiki">IntelliSense</a> is "compiling" (with no file output, of course) code in the background to offer the red squiggly lines that point out programming mistakes before you actually compile the code with VC++. </p> <p> And while it does that, the <code>__EDG__</code> macro and some others, beginning with <code>__EDG</code>, are defined for whatever reason. Because the <a class="missing wiki">IntelliSense</a> compiler is working very similarly to the VC++ compiler, it would of course need the workarounds for variadic macros to expand all the macros correctly, which are not used because <code>__EDG__</code> is defined. </p> <p> What that means is that certain macros of Boost.PP are underlined as programming errors by <a class="missing wiki">IntelliSense</a>, but compile perfectly fine under VC++, as it doesn't define <code>__EDG__</code>. I have no idea why <a class="missing wiki">IntelliSense</a> does it, it really makes no sense to me. </p> <p> So this really isn't a showstopper or anything, but it is annoying. </p> <p> What I propose as a fix is that you also check if <code>__INTELLISENSE__</code> is defined, and base the definition of <code>BOOST_PP_VARIADICS</code> and <code>BOOST_PP_VARIADICS_MSVC</code> on that, too. </p> <p> BTW: to prevent macros showing up like <span class="underline">THIS</span>, enclose them in backticks. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Edward Diener</dc:creator> <pubDate>Sun, 09 Nov 2014 19:35:44 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10686#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10686#comment:6</guid> <description> <p> I have updated the 'develop' branch of Boost PP in the current Boost on Github to fix this problem in general. If you could get this update and test against your source it would be appreciated. Alternatively I need some source to test your problems to see if the update I have made fixes them. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Edward Diener</dc:creator> <pubDate>Sun, 17 May 2015 02:20:57 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10686#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10686#comment:7</guid> <description> <p> This is fixed in the Boost 1.58 release. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Edward Diener</dc:creator> <pubDate>Sun, 17 May 2015 02:21:11 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/10686#comment:8 https://svn.boost.org/trac10/ticket/10686#comment:8 <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