Index: gcc/flags.h
===================================================================
--- gcc/flags.h	(revision 186957)
+++ gcc/flags.h	(working copy)
@@ -51,13 +51,10 @@ extern void set_Wstrict_aliasing (struct
 
 /* True if printing into -fdump-final-insns= dump.  */
 
 extern bool final_insns_dump_p;
 
-/* Nonzero means make permerror produce warnings instead of errors.  */
-
-extern int flag_permissive;
 
 /* Other basic status info about current function.  */
 
 /* Target-dependent global state.  */
 struct target_flag_state {
Index: gcc/c-family/c.opt
===================================================================
--- gcc/c-family/c.opt	(revision 186957)
+++ gcc/c-family/c.opt	(working copy)
@@ -976,11 +976,11 @@ C ObjC C++ ObjC++
 fpch-preprocess
 C ObjC C++ ObjC++
 Look for and use PCH files even when preprocessing
 
 fpermissive
-C++ ObjC++
+C++ ObjC++ Var(flag_permissive)
 Downgrade conformance errors to warnings
 
 fplan9-extensions
 C ObjC Var(flag_plan9_extensions)
 Enable Plan 9 language extensions
Index: gcc/diagnostic.c
===================================================================
--- gcc/diagnostic.c	(revision 186957)
+++ gcc/diagnostic.c	(working copy)
@@ -540,11 +540,12 @@ diagnostic_report_diagnostic (diagnostic
       && diagnostic->kind == DK_WARNING)
     {
       diagnostic->kind = DK_ERROR;
     }
 
-  if (diagnostic->option_index)
+  if (diagnostic->option_index
+      && diagnostic->option_index != permissive_error_option (context))
     {
       diagnostic_t diag_class = DK_UNSPECIFIED;
 
       /* This tests if the user provided the appropriate -Wfoo or
 	 -Wno-foo option.  */
Index: gcc/toplev.c
===================================================================
--- gcc/toplev.c	(revision 186957)
+++ gcc/toplev.c	(working copy)
@@ -143,14 +143,10 @@ unsigned local_tick;
 /* Random number for this compilation */
 HOST_WIDE_INT random_seed;
 
 /* -f flags.  */
 
-/* Nonzero means make permerror produce warnings instead of errors.  */
-
-int flag_permissive = 0;
-
 /* When non-NULL, indicates that whenever space is allocated on the
    stack, the resulting stack pointer must not pass this
    address---that is, for stacks that grow downward, the stack pointer
    must always be greater than or equal to this address; for stacks
    that grow upward, the stack pointer must be less than this address.
Index: gcc/c-tree.h
===================================================================
--- gcc/c-tree.h	(revision 186957)
+++ gcc/c-tree.h	(working copy)
@@ -619,14 +619,10 @@ extern int current_function_returns_null
 /* Set to 0 at beginning of a function definition, set to 1 if
    a call to a noreturn function is seen.  */
 
 extern int current_function_returns_abnormally;
 
-/* Nonzero means we are reading code that came from a system header file.  */
-
-extern int system_header_p;
-
 /* Mode used to build pointers (VOIDmode means ptr_mode).  */
 
 extern enum machine_mode c_default_pointer_mode;
 
 /* In c-decl.c */
