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

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

Himanshu2
Beginner
1,273 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
1,126 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

0 Kudos
5 Replies
Gopika_Intel
Moderator
1,232 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


0 Kudos
Gopika_Intel
Moderator
1,208 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


0 Kudos
Gopika_Intel
Moderator
1,189 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


0 Kudos
Himanshu2
Beginner
1,127 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

0 Kudos
Gopika_Intel
Moderator
1,091 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

 

0 Kudos
Reply