Blame SOURCES/0003-Add-std-extra-legacy.patch

2985e0
From d1bb76287ec58fdde7ced70088559136555bd7bd Mon Sep 17 00:00:00 2001
2985e0
From: Jim MacArthur <jim.macarthur@codethink.co.uk>
2985e0
Date: Fri, 11 Dec 2015 17:04:09 +0000
2985e0
Subject: [PATCH 03/23] Add -std=extra-legacy
2985e0
2985e0
2985e0
        0003-Add-std-extra-legacy.patch
2985e0
    
2985e0
        0023-Add-a-full-stop-to-the-std-extra-legacy-help-text.patch
2985e0
2985e0
diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt
2985e0
index 4421ce4..4808c27 100644
2985e0
--- a/gcc/fortran/lang.opt
2985e0
+++ b/gcc/fortran/lang.opt
2985e0
@@ -790,6 +790,10 @@ std=legacy
2985e0
 Fortran
2985e0
 Accept extensions to support legacy code.
2985e0
 
2985e0
+std=extra-legacy
2985e0
+Fortran
2985e0
+Accept even more legacy extensions, including things disallowed in f90.
2985e0
+
2985e0
 undef
2985e0
 Fortran
2985e0
 ; Documented in C
2985e0
diff --git a/gcc/fortran/libgfortran.h b/gcc/fortran/libgfortran.h
2985e0
index c5ff992..dcc923b 100644
2985e0
--- a/gcc/fortran/libgfortran.h
2985e0
+++ b/gcc/fortran/libgfortran.h
2985e0
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3.
2985e0
    Note that no features were obsoleted nor deleted in F2003.
2985e0
    Please remember to keep those definitions in sync with
2985e0
    gfortran.texi.  */
2985e0
+#define GFC_STD_EXTRA_LEGACY	(1<<13)	/* Even more backward compatibility.  */
2985e0
 #define GFC_STD_F2018_DEL      (1<<12)  /* Deleted in F2018.  */
2985e0
 #define GFC_STD_F2018_OBS      (1<<11)  /* Obsolescent in F2018.  */
2985e0
 #define GFC_STD_F2018          (1<<10)  /* New in F2018.  */
2985e0
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
2985e0
index 1af76aa..9ebf8e3 100644
2985e0
--- a/gcc/fortran/options.c
2985e0
+++ b/gcc/fortran/options.c
2985e0
@@ -733,6 +733,12 @@ gfc_handle_option (size_t scode, const char *arg, int value,
2985e0
       gfc_option.warn_std = 0;
2985e0
       break;
2985e0
 
2985e0
+    case OPT_std_extra_legacy:
2985e0
+      set_default_std_flags ();
2985e0
+      gfc_option.warn_std = 0;
2985e0
+      gfc_option.allow_std |= GFC_STD_EXTRA_LEGACY;
2985e0
+      break;
2985e0
+
2985e0
     case OPT_fshort_enums:
2985e0
       /* Handled in language-independent code.  */
2985e0
       break;