Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22133

pragma ignored in g++ and clang

$
0
0

I would like to disable specific known warnings in C++ code coming from a library header when compiling my own code. There are clang and gcc specific methods for disabling the warnings. The way this is done is almost identical.

For clang:

#pragma clang diagnostic push#pragma clang diagnostic ignored "-Wunused-local-typedefs"#include <library.h>  #pragma clang diagnostic pop

For gcc:

#pragma GCC diagnostic push#pragma GCC diagnostic ignored "-Wunused-local-typedefs"#include <library.h>#pragma GCC diagnostic pop

Is there a clean way to suppress these warnings that is portable across clang and GCC?


Viewing all articles
Browse latest Browse all 22133

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>