Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

how to suppress a warning on four lines of code only

Matthias_Kretz
New Contributor I
605 Views

Hi, I need to suppress a bogus warning from ICC, but I'm unable to do it. :( Here's the warning: warning #13211: Immediate parameter to intrinsic call too large This warning is printed for four successive lines of code. It is incorrect, though. ICC fails to determine that for the given template parameters these lines are unreachable. So I'd like to just make ICC shut up. I added #pragma warning push #pragma warning disable 13211 #pragma warning pop This has no effect (well, except to change the line numbers in the warning messages :) ). "suppress" as keyword is not recognized. I tried the MSVC syntax "#pragma warning(disable : 13211)", but that doesn't change anything. Does anybody know how to do this properly? (Other than template specialization == unnecessary code duplication.)

0 Kudos
9 Replies
Georg_Z_Intel
Employee
605 Views
Hello, could you please provide me a small reproducer that shows this kind of warning? Not all warnings can be suppressed by using the pragma approach due to internal handling. Using intrinsics might be one of those cases, but I'd need to check. Thank you & best regards, Georg Zitzlsberger
0 Kudos
SergeyKostrov
Valued Contributor II
605 Views
>>...MSVC syntax "#pragma warning(disable : 13211)", but that doesn't change anything... I would try: - to disable the warning in a VS project settings, like: Disable Specific Diagnostics=13211 - to lower a Warning Level to less than 3 I've experienced similar issues in the past and unfortunately some warning messages should be disabled in a VS project settings.
0 Kudos
Matthias_Kretz
New Contributor I
605 Views

Simple testcase:
[cpp]#include __m128i foo(__m128i v) { #pragma warning disable 13211 return _mm_alignr_epi8(v, v, 7 * 8); } [/cpp] @Sergey: actually I'm working with ICC on Linux. It's just that the ICC docs don't document #pragma warning other than being there because other compilers provide it. And the only other compiler that supports this pragma, that I know of, is MSVC... I was trying to avoid the need for -diag-disable because this code is in a header of a library.

0 Kudos
Georg_Z_Intel
Employee
605 Views
Hello, I can confirm the problem. It seems to be a bug that #pragma warning... does not disable the warning. I've forwarded it to engineering (DPD200240309) and let you know about the outcome. I've also forwarded the problem regarding the erroneous warning message that I'm going to see on both Linux* & Windows*. Best regards, Georg Zitzlsberger
0 Kudos
Matthias_Kretz
New Contributor I
605 Views
Thanks!
0 Kudos
SergeyKostrov
Valued Contributor II
605 Views
>>...actually I'm working with ICC on Linux. It's just that the ICC docs don't document #pragma warning... Thank you for clarification because it wasn't specified in your initial post. Of course, my advise '...some warning messages should be disabled in a VS project settings...' is not applicable.
0 Kudos
SergeyKostrov
Valued Contributor II
605 Views
>>... I've forwarded it to engineering ( DPD200240309 ) and let you know about the outcome Hi Georg, I remember that there was a list ( somewhere on Intel web-site ) with all active bugs, issues, problems, etc, coded as DPDxxxxxxxxx for Intel C++ compiler. Could we see up-to-date version? Or, is the list internal for Intel employees only? Best regards, Sergey
0 Kudos
Georg_Z_Intel
Employee
605 Views
Hi Sergey, the lists are official, which is why I prefer to also name the ticket IDs. That way everyone can see him/herself when fixed in case I should miss updating one or the other thread. Depending on the version, there are currently three lists: Intel® Professional Edition compilers (no further updates): http://software.intel.com/en-us/articles/intel-professional-edition-compilers-111-fixes-list Intel(R) Composer XE 2011 compilers (no further updates): http://software.intel.com/en-us/articles/intel-composer-xe-2011-compilers-fixes-list Intel(R) Composer XE 2013 compilers: http://software.intel.com/en-us/articles/intel-composer-xe-2013-compilers-fixes-list Best regards, Georg Zitzlsberger
0 Kudos
SergeyKostrov
Valued Contributor II
605 Views
Thank you, Georg! Exactly what I wanted to find...
0 Kudos
Reply