aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/options.c
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2007-02-23 07:14:04 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2007-02-23 07:14:04 +0000
commita47eec17b411a9d858ee62a5237a62ec5238de6f (patch)
treec6ebad0a6894c881bc369ab17c1fd9177db20a84 /gcc/fortran/options.c
parent2bc677620cdb1093eb859d48580690bb7777aa3a (diff)
downloadgcc-a47eec17b411a9d858ee62a5237a62ec5238de6f.zip
gcc-a47eec17b411a9d858ee62a5237a62ec5238de6f.tar.gz
gcc-a47eec17b411a9d858ee62a5237a62ec5238de6f.tar.bz2
options.c (set_default_std_flags): New function to consolidate setting the flags.
2007-02-22 Jerry DeLisle <jvdelisle@gcc.gnu.org> * options.c (set_default_std_flags): New function to consolidate setting the flags. (gfc_init_options): Use new function. (gfc_handle_option): Use new function. From-SVN: r122252
Diffstat (limited to 'gcc/fortran/options.c')
-rw-r--r--gcc/fortran/options.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index bd8f6eb..e4f6092 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -36,6 +36,18 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
gfc_option_t gfc_option;
+/* Set flags that control warnings and errors for different
+ Fortran standards to their default values. */
+
+static void
+set_default_std_flags (void)
+{
+ gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
+ | GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F77 | GFC_STD_GNU
+ | GFC_STD_LEGACY;
+ gfc_option.warn_std = GFC_STD_F95_DEL | GFC_STD_LEGACY;
+}
+
/* Get ready for options handling. */
unsigned int
@@ -97,10 +109,7 @@ gfc_init_options (unsigned int argc ATTRIBUTE_UNUSED,
flag_errno_math = 0;
- gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
- | GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F77 | GFC_STD_GNU
- | GFC_STD_LEGACY;
- gfc_option.warn_std = GFC_STD_F95_DEL | GFC_STD_LEGACY;
+ set_default_std_flags ();
gfc_option.warn_nonstd_intrinsics = 0;
@@ -624,17 +633,11 @@ gfc_handle_option (size_t scode, const char *arg, int value)
break;
case OPT_std_gnu:
- gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
- | GFC_STD_F77 | GFC_STD_F95 | GFC_STD_F2003
- | GFC_STD_GNU | GFC_STD_LEGACY;
- gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
- | GFC_STD_LEGACY;
+ set_default_std_flags ();
break;
case OPT_std_legacy:
- gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
- | GFC_STD_F77 | GFC_STD_F95 | GFC_STD_F2003
- | GFC_STD_GNU | GFC_STD_LEGACY;
+ set_default_std_flags ();
gfc_option.warn_std = 0;
break;