Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
Announcements
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.
7779 Discussions

What is the equivalent of '#pragma GCC system_header' for icc?

Himanshu2
Beginner
869 Views

I want icc to not give any warnings for a particular header file. For gcc/clang #pragma GCC system_header tells the compiler to treat a file as a system header and ignore all the warnings.

I am aware of the option to disable warnings selectively, but there are way too many warnings because the header files are very old.

Thanks

0 Kudos
1 Solution
Himanshu2
Beginner
722 Views

I have attached a minimum working example. 

I tested it on two different versions of icc, it seems like '#pragma GCC system_header' was added to icc in some version after 16.0.03.

For icc version 16.0.03, if one removes the warning codes to be ignore the above code will not compile but it will compile for icc version 19.1.2.254 because this version understands '#pragma GCC system_header'.

I am marking this issue as resolved because '#pragma GCC system_header' was added to newer versions of icc.

Thanks

View solution in original post

5 Replies
Gopika_Intel
Moderator
828 Views

Hi,

 

Thank you for posting in Intel C++ Compiler forum. We’re checking this with our team. We’ll get back to you with an answer.

 

Regards

Gopika


Gopika_Intel
Moderator
804 Views

Hi,

 

Thank you for your patience. Could you please provide us with a reproducer code so that we can try it from our end?

 

Regards

Gopika


Gopika_Intel
Moderator
785 Views

Hi,

 

We haven’t heard from you in a while. Is your query resolved? If not, could you please provide us with a reproducer code so that we can try it from our end. Let us know your updates.

 

Regards

Gopika


Himanshu2
Beginner
723 Views

I have attached a minimum working example. 

I tested it on two different versions of icc, it seems like '#pragma GCC system_header' was added to icc in some version after 16.0.03.

For icc version 16.0.03, if one removes the warning codes to be ignore the above code will not compile but it will compile for icc version 19.1.2.254 because this version understands '#pragma GCC system_header'.

I am marking this issue as resolved because '#pragma GCC system_header' was added to newer versions of icc.

Thanks

Gopika_Intel
Moderator
687 Views

Hi,

Thank you for providing the information. Glad to know your query is resolved. As the query is resolved we are no longer monitoring this thread. For further queries and issues please raise a new thread. We’d be happy to help you.

Regards

Gopika

 

Reply