<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 21 Jan 2022 at 03:16, Thomas Monjalon <<a href="mailto:thomas@monjalon.net">thomas@monjalon.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">18/01/2022 00:23, Michael Barker:<br>
> When using clang with -Wall the use of diagnose_if kicks up a warning,<br>
<br>
Please could you copy the warning in the commit log?<br></blockquote><div><br></div><div><div style="font-size:small" class="gmail_default">I've updated the commit log to be more descriptive (and included the associated warning).</div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> requiring all dpdk includes to be wrapped with the pragma. This change<br>
> isolates the ignore just the appropriate location and makes it easier<br>
> for users to apply -Wall,-Werror<br>
<br>
Please could you explain how it is related to -Wgcc-compat?<br></blockquote><div><br></div><div><div style="font-size:small" class="gmail_default">I'm currently working on some code that makes use of DPDK, which is built with '-Wall,-Werror' enabled. When using the clang toolchain the build fails as a result of this macro that this patch updates. The workaround from my application is to wrap all of the DPDK header includes in pragma to disable the warnings (see below). This has the unfortunate side effect of disabling this warning across all of the included DPDK headers, which is not ideal. Hence the reason to submit the patch which disables the warning just in the location where it occurs.<br></div><div style="font-size:small" class="gmail_default"><br><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"JetBrains Mono",monospace;font-size:9pt"><span style="color:rgb(128,128,0)">#if </span>defined(<span style="color:rgb(31,84,46);font-weight:bold">__clang__</span>)<br><span style="color:rgb(56,73,46)">#pragma GCC diagnostic push<br></span><span style="color:rgb(56,73,46)">#pragma GCC diagnostic ignored </span><span style="color:rgb(56,73,46);font-weight:bold">"-Wgcc-compat"<br></span><span style="color:rgb(128,128,0)">#endif<br></span><span style="color:rgb(128,128,0)">#include </span><span style="color:rgb(0,128,0);font-weight:bold"><rte_ethdev.h><br></span><span style="color:rgb(128,128,0)">#if </span>defined(<span style="color:rgb(31,84,46);font-weight:bold">__clang__</span>)<br><span style="color:rgb(56,73,46)">#pragma GCC diagnostic pop </span><span style="color:rgb(56,73,46);font-weight:bold">"-Wgcc-compat"<br></span><span style="color:rgb(128,128,0)">#endif<br></span></pre></div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
[...]<br>
> #define __rte_internal \<br>
> +_Pragma("GCC diagnostic push") \<br>
> +_Pragma("GCC diagnostic ignored \"-Wgcc-compat\"") \<br>
> __attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \<br>
> -section(".text.internal")))<br>
> +section(".text.internal"))) \<br>
> +_Pragma("GCC diagnostic pop")<br>
<br>
<br>
<br>
</blockquote></div></div>