aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/options.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2005-05-30 22:16:08 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2005-05-30 22:16:08 +0000
commitc0309c74caa1610563501948e1ddfcd1e997556d (patch)
treebecb120b72d22a9e2b88e2936d6e3da4b6a7cec4 /gcc/fortran/options.c
parentd5c405cc717dc39fb20b9dc013400f4da9a143e4 (diff)
downloadgcc-c0309c74caa1610563501948e1ddfcd1e997556d.zip
gcc-c0309c74caa1610563501948e1ddfcd1e997556d.tar.gz
gcc-c0309c74caa1610563501948e1ddfcd1e997556d.tar.bz2
gfortran.h (GFC_STD_LEGACY): New "standard" macro.
* gfortran.h (GFC_STD_LEGACY): New "standard" macro. Reindent. * options.c (gfc_init_options): By default, allow legacy extensions but warn about them. (gfc_post_options): Make -pedantic warn about legacy extensions even with -std=legacy. (gfc_handle_option): Make -std=gnu follow the default behaviour of warning about legacy extensions, but allowing them. Make the new -std=legacy accept everything and warn about nothing. * lang.opt (std=legacy): New F95 command line option. * invoke.texi: Document both -std=f2003 and -std=legacy. * gfortran.texi: Explain the two types of extensions and document how they are affected by the various -std= command line options. From-SVN: r100377
Diffstat (limited to 'gcc/fortran/options.c')
-rw-r--r--gcc/fortran/options.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index 2603caa..347f706 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -77,9 +77,10 @@ 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_F2003 | GFC_STD_F95 | GFC_STD_F77 | GFC_STD_GNU
+ | GFC_STD_LEGACY;
gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
- | GFC_STD_F2003;
+ | GFC_STD_F2003 | GFC_STD_LEGACY;
gfc_option.warn_nonstd_intrinsics = 0;
@@ -113,6 +114,9 @@ gfc_post_options (const char **pfilename)
/* If -pedantic, warn about the use of GNU extensions. */
if (pedantic && (gfc_option.allow_std & GFC_STD_GNU) != 0)
gfc_option.warn_std |= GFC_STD_GNU;
+ /* -std=legacy -pedantic is effectively -std=gnu. */
+ if (pedantic && (gfc_option.allow_std & GFC_STD_LEGACY) != 0)
+ gfc_option.warn_std |= GFC_STD_F95_OBS | GFC_STD_F95_DEL | GFC_STD_LEGACY;
/* If the user didn't explicitly specify -f(no)-second-underscore we
use it if we're trying to be compatible with f2c, and not
@@ -333,8 +337,16 @@ gfc_handle_option (size_t scode, const char *arg, int value)
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_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL;
+ | GFC_STD_GNU | GFC_STD_LEGACY;
+ gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
+ | GFC_STD_LEGACY;
+ 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;
+ gfc_option.warn_std = 0;
break;
case OPT_Wnonstd_intrinsics: