"pragma GCC diagnostic ignored" has no effect if it's defined in PCH?

2.4k views Asked by At

I have several diagnostic pragmas in a header file.

#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wmissing-braces"

When I compiled this header file as PCH, these pragmas seem to have no effects in any other source files. However if I don't compiled it as PCH, it works correctly.

I'm not sure if this is a GCC bug? or maybe I'm missing something?

PS: I don't want to ignored these warnings by adding compiler options.

1

There are 1 answers

0
PatchyFog On

See comment 5 here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431

Likely a currently unsupported feature related to when things are lexed.