3

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.

Lendy Zhang
  • 135
  • 7

1 Answers1

1

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.

PatchyFog
  • 1,551
  • 16
  • 17