From: jvdelisle Date: Fri, 23 Feb 2007 07:14:04 +0000 (+0000) Subject: 2007-02-22 Jerry DeLisle X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=83a65a0d829401359e5b0c1c0167c1f215865a7f;p=thirdparty%2Fgcc.git 2007-02-22 Jerry DeLisle * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122252 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index d6f0b271faaf..ce305532ed80 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2007-02-22 Jerry DeLisle + + * 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. + 2007-02-22 Brooks Moses * gfortran.texi (Old-style kind specifications): Document diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c index bd8f6ebf05e6..e4f6092663cc 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;