<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I use pragma warning without warning numbers? in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-do-I-use-pragma-warning-without-warning-numbers/m-p/1631809#M4093</link>
    <description>&lt;P&gt;I've escalated your question to our internal team for further investigation. Thanks.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Sep 2024 20:00:52 GMT</pubDate>
    <dc:creator>Alex_Y_Intel</dc:creator>
    <dc:date>2024-09-17T20:00:52Z</dc:date>
    <item>
      <title>How do I use pragma warning without warning numbers?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-do-I-use-pragma-warning-without-warning-numbers/m-p/1631473#M4092</link>
      <description>&lt;P&gt;We typically compile our codes with -Wall, but we have to selectively disable warnings around the include statements that import headers from third-party libraries which we have no direct control over, so that the warnings from the third-party headers do not pollute our compiler outputs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In our code, we have used two macros for that task, which looked like this in the case of the "classic" Intel C++ compiler:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;#define DISABLE_WARNINGS_MACRO _Pragma("warning(push,0)") \
    _Pragma("warning(disable:177)") \
    _Pragma("warning(disable:2259)") \
    _Pragma("warning(disable:1478)") \
    _Pragma("warning(disable:1599)") \
    _Pragma("warning(disable:1944)") \
    _Pragma("warning(disable:3280)") \
    _Pragma("warning(disable:858)")

#define RESTORE_WARNINGS_MACRO _Pragma("warning(pop)")&lt;/LI-CODE&gt;&lt;P&gt;And the typical use case looked something like this:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;#include &amp;lt;iostream&amp;gt;
DISABLE_WARNINGS_MACRO
#include &amp;lt;thirdparty/somelibrary/nastyheader.h&amp;gt;
RESTURE_WARNINGS_MACRO
...&lt;/LI-CODE&gt;&lt;P&gt;According to the &lt;A href="https://www.intel.com/content/www/us/en/docs/dpcpp-cpp-compiler/developer-guide-reference/2024-2/pragmas-compatible-with-other-compilers.html" target="_self"&gt;list of pragmas supported by ICPX&lt;/A&gt; the warning pragma is still supported. However, according to the &lt;A href="https://www.intel.com/content/www/us/en/developer/articles/guide/porting-guide-for-icc-users-to-dpcpp-or-icx.html" target="_self"&gt;Porting Guide for ICC Users to DPCPP or ICX&lt;/A&gt; it says that&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;However, ICX does not have numbered diagnostic message, instead, it prints a hint about which diagnostic option can be used to control the diagnostic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And that's exactly what happens, I now only get the warning command line options in the output, e.g.:&lt;/P&gt;&lt;LI-CODE lang="none"&gt;thirdparty/boost_1_80_0/boost/type_traits/has_nothrow_copy.hpp:36:89: warning: builtin __has_nothrow_copy is deprecated; use __is_nothrow_constructible instead [-Wdeprecated-builtins]
   36 | template &amp;lt;class T&amp;gt; struct has_nothrow_copy_constructor : public integral_constant&amp;lt;bool, BOOST_HAS_NOTHROW_COPY(T)&amp;gt;{};
      |                                                                                         ^
thirdparty/boost_1_80_0/boost/type_traits/intrinsics.hpp:202:41: note: expanded from macro 'BOOST_HAS_NOTHROW_COPY'
  202 | #     define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) &amp;amp;&amp;amp; !is_volatile&amp;lt;T&amp;gt;::value &amp;amp;&amp;amp; !is_reference&amp;lt;T&amp;gt;::value &amp;amp;&amp;amp; is_copy_constructible&amp;lt;T&amp;gt;::value)
      |                                         ^&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, my question should be obvious by now: What arguments do I have to pass to the warning pragma to disable a specific warning if the compiler output does not emit the warning numbers anymore?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 08:58:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-do-I-use-pragma-warning-without-warning-numbers/m-p/1631473#M4092</guid>
      <dc:creator>Peter_Zajac</dc:creator>
      <dc:date>2024-09-16T08:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use pragma warning without warning numbers?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-do-I-use-pragma-warning-without-warning-numbers/m-p/1631809#M4093</link>
      <description>&lt;P&gt;I've escalated your question to our internal team for further investigation. Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 20:00:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-do-I-use-pragma-warning-without-warning-numbers/m-p/1631809#M4093</guid>
      <dc:creator>Alex_Y_Intel</dc:creator>
      <dc:date>2024-09-17T20:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use pragma warning without warning numbers?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-do-I-use-pragma-warning-without-warning-numbers/m-p/1631969#M4095</link>
      <description>&lt;P&gt;Hello, I have just figured out (by trial-&amp;amp;-error) that apparently the &lt;A href="https://clang.llvm.org/docs/UsersManual.html#controlling-diagnostics-via-pragmas" target="_self"&gt;clang-style diagnostics pragmas&lt;/A&gt; seem to work with the icpx compiler, which would make sense, since it is based on LLVM. So for example one could use&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;#define DISABLE_WARNINGS _Pragma("clang diagnostic push") \
  _Pragma("clang diagnostic ignored \"-Wall\"") \
  _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") \
  _Pragma("clang diagnostic ignored \"-Wshadow\"") \
  _Pragma("clang diagnostic ignored \"-Wunused-parameter\"") \
  _Pragma("clang diagnostic ignored \"-Wdeprecated-builtins\"") \
  _Pragma("clang diagnostic ignored \"-Wdeprecated-copy-with-user-provided-dtor\"")

#define RESTORE_WARNINGS _Pragma("clang diagnostic pop")&lt;/LI-CODE&gt;&lt;P&gt;to turn off individual warnings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So it seems that this is primarily a documentation issue of the &lt;A href="https://www.intel.com/content/www/us/en/docs/dpcpp-cpp-compiler/developer-guide-reference/2024-2/pragmas.html" target="_self"&gt;pragmas documentation of the ICPX compiler&lt;/A&gt;, which still contains the old numbered warnings pragmas, which were similar to the style used by Microsoft's compilers.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 09:47:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-do-I-use-pragma-warning-without-warning-numbers/m-p/1631969#M4095</guid>
      <dc:creator>Peter_Zajac</dc:creator>
      <dc:date>2024-09-18T09:47:09Z</dc:date>
    </item>
  </channel>
</rss>

