Boost C++ Libraries: Ticket #7094: warning: unrecognized #pragma GCC system_header https://svn.boost.org/trac10/ticket/7094 <p> Hello, </p> <p> Below is a list of files, that contain something like: </p> <pre class="wiki">#if defined(__GNUC__) #pragma GCC system_header #endif </pre><p> which causes a warning on my TI compiler. </p> <pre class="wiki">boost\exception\all.hpp boost\exception\current_exception_cast.hpp boost\exception\detail\error_info_impl.hpp boost\exception\detail\exception_ptr.hpp boost\exception\detail\is_output_streamable.hpp boost\exception\detail\object_hex_dump.hpp boost\exception\detail\type_info.hpp boost\exception\diagnostic_information.hpp boost\exception\errinfo_errno.hpp boost\exception\exception.hpp boost\exception\get_error_info.hpp boost\exception\info.hpp boost\exception\info_tuple.hpp boost\exception\to_string.hpp boost\exception\to_string_stub.hpp boost\throw_exception.hpp </pre><p> In other files, i.e. boost\integer.hpp, I've found this #pragma guarded against <code>__GNUC__ &gt;= 4</code>: </p> <pre class="wiki">#if defined(__GNUC__) &amp;&amp; (__GNUC__ &gt;= 4) #pragma GCC system_header #endif </pre><p> which doesn't cause a warning on my compiler, because it defines <code>__GNUC__=3</code>. </p> <p> Could this be fixed in the files on the list above, or are there some <code>__GNUC__=3</code> compilers, that need this pragma to be enabled? </p> <p> Regards, Kris </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7094 Trac 1.4.3 anonymous Fri, 06 Jul 2012 19:11:34 GMT <link>https://svn.boost.org/trac10/ticket/7094#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7094#comment:1</guid> <description> <p> Thanks for reporting this bug. Could you please tell me the value of <span class="underline">GNUC_MINOR</span> for your compiler? </p> </description> <category>Ticket</category> </item> <item> <author>1czajnik@…</author> <pubDate>Mon, 09 Jul 2012 07:40:34 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7094#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7094#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7094#comment:1" title="Comment 1">anonymous</a>: </p> <blockquote class="citation"> <p> Thanks for reporting this bug. Could you please tell me the value of <code>__GNUC_MINOR__</code> for your compiler? </p> </blockquote> <p> Sure, <code>__GNUC_MINOR__</code> is defined to 0 for this TI compiler. </p> <p> Cheers, Kris </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Emil Dotchevski</dc:creator> <pubDate>Tue, 10 Jul 2012 03:43:58 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7094#comment:3 https://svn.boost.org/trac10/ticket/7094#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> <p> Fixed in trunk revision 79398 </p> Ticket 1czajnik@… Tue, 10 Jul 2012 10:31:47 GMT <link>https://svn.boost.org/trac10/ticket/7094#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7094#comment:4</guid> <description> <p> Thanks for fixing this, Emil. I took a look at 79398, and I think this should work for my compiler. But one thing came to my mind: what about compilers, that don't define <code>__GNUC__</code> at all? </p> <p> I mean, don't we need some additional guards like: </p> <pre class="wiki">#if defined(__GNUC__) &amp;&amp; defined(__GNUC_MINOR__) &amp;&amp; \ (__GNUC__*100+__GNUC_MINOR__&gt;301) &amp;&amp; \ !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) </pre> </description> <category>Ticket</category> </item> <item> <author>1czajnik@…</author> <pubDate>Tue, 10 Jul 2012 16:13:16 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7094#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7094#comment:5</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7094#comment:4" title="Comment 4">1czajnik@…</a>: </p> <blockquote class="citation"> <p> Thanks for fixing this, Emil. I took a look at 79398, and I think this should work for my compiler. But one thing came to my mind: what about compilers, that don't define <code>__GNUC__</code> at all? </p> <p> I mean, don't we need some additional guards like: </p> <pre class="wiki">#if defined(__GNUC__) &amp;&amp; defined(__GNUC_MINOR__) &amp;&amp; \ (__GNUC__*100+__GNUC_MINOR__&gt;301) &amp;&amp; \ !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) </pre></blockquote> <p> False alarm, I just checked in MinGW, that something like: </p> <pre class="wiki">#if (asdf*100+ghjk &gt; 5) #error #endif </pre><p> compiles fine without asdf or ghjk defined. I didn't know the preprocessor was supposed to work like this ;-) Cheers </p> </description> <category>Ticket</category> </item> <item> <author>wojciech.migda@…</author> <pubDate>Wed, 01 Oct 2014 10:23:45 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7094#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7094#comment:6</guid> <description> <p> Can you please fix it in static_assert.hpp as well? TI DSP compiler complains about undefined pragma there: </p> <p> #if defined(<span class="underline">GNUC</span>) &amp;&amp; !defined(<span class="underline">GXX_EXPERIMENTAL_CXX0X</span>) <em> </em> This is horrible, but it seems to be the only we can shut up the <em> "anonymous variadic macros were introduced in C99 [-Wvariadic-macros]" </em> warning that get spewed out otherwise in non-C++11 mode. <em> #pragma GCC system_header #endif </em></p> <p> I am using TI DSP C++ 7.3.5 and Boost 1.56. Should I report a separate ticket for this? </p> <p> Thanks, Wojciech </p> </description> <category>Ticket</category> </item> </channel> </rss>