inform that diagnostics in functions won't work, but don't error out
authorespie <espie@openbsd.org>
Fri, 20 Jul 2018 10:02:03 +0000 (10:02 +0000)
committerespie <espie@openbsd.org>
Fri, 20 Jul 2018 10:02:03 +0000 (10:02 +0000)
flatly.

this will help sparc64 compile code without needing to patch away recent
pragma diagnostic use.

problem found by landry@

okay kettenis@, guenther@

gnu/gcc/gcc/c-pragma.c

index b2712ac..3f9c7ea 100644 (file)
@@ -691,7 +691,7 @@ handle_pragma_diagnostic(cpp_reader *ARG_UNUSED(dummy))
 
   if (cfun)
     {
-      error ("#pragma GCC diagnostic not allowed inside functions");
+      warning (OPT_Wpragmas, "#pragma GCC diagnostic ignored inside functions");
       return;
     }