oarfish
oarfish

Reputation: 4622

How can I ignore all warnings from included headers in clang/gcc?

I want to use #pragma clang diagnostic push to ignore warnings from some included header files. So I write this:

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wall"
#include "SpinGenApi/SpinnakerGenApi.h"
#include "Spinnaker.h"
#pragma clang diagnostic pop

But still the compiler prints warnings when compiling the file with this code. What do I need to change so that all warnings are ignored for these headers?

Upvotes: 3

Views: 1615

Answers (1)

oarfish
oarfish

Reputation: 4622

The answer seems to be in this case that -Wall contrary to its name did not include the warnings which I wanted to suppress. I added #pragma clang diagnostic ignored "-Weverything" as well and they went away.

Upvotes: 6

Related Questions