aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/options.c
diff options
context:
space:
mode:
authorJanne Blomqvist <jblomqvi@cc.hut.fi>2004-10-31 03:24:29 +0200
committerPaul Brook <pbrook@gcc.gnu.org>2004-10-31 01:24:29 +0000
commitb789258287043cbe3b05675d281faf9d4c9e2760 (patch)
treeb5b041323c25b727232c8af83c61b4df9b68a294 /gcc/fortran/options.c
parent13747d3edad2812390d0f46c0ede0a7aa03442f4 (diff)
downloadgcc-b789258287043cbe3b05675d281faf9d4c9e2760.zip
gcc-b789258287043cbe3b05675d281faf9d4c9e2760.tar.gz
gcc-b789258287043cbe3b05675d281faf9d4c9e2760.tar.bz2
re PR fortran/17590 (Standard conformance should take intrinsics into account.)
2004-10-31 Janne Blomqvist <jblomqvi@cc.hut.fi> PR fortran/17590 * gfortran.h: Change GFC_STD_* flags to more appropriate ones. (struct gfc_intrinsic_isym): Add field for standard. (struct gfc_option_t): Add field for warning about use of nonstandard intrinsics. * intrinsic.c (add_sym): Add parameter for standard version, check this against current standard. (add_sym_0): Pass standard parameter to add_sym. (add_sym_1, add_sym_0s, add_sym_1s, add_sym_1m, add_sym_2): Ditto. (add_sym_2s, add_sym_3, add_sym_3ml, add_sym_3red, add_sym_3s): Ditto. (add_sym_4, add_sym_4s, add_sym_5, add_sym_5s): Ditto. (make_generic): Add parameter for standard, check this against currently selected standard. (add_functions, add_subroutines): Add parameter to tell which standard an intrinsic belongs to. (check_intrinsic_standard): New function. (gfc_intrinsic_func_interface): Add call to check_intrinsic_standard. (gfc_intrinsic_sub_interface): Ditto. * lang.opt: Add Wnonstd-intrinsics option. * options.c (gfc_init_options): Change to use new GFC_STD_* flags, init new warning. (set_Wall): Add warning about nonstd intrinsics. (gfc_handle_option): Change to use new GFC_STD_* flags, handle new warning. * invoke.texi: Update manual to include -Wnonstd-intrinsics. From-SVN: r89907
Diffstat (limited to 'gcc/fortran/options.c')
-rw-r--r--gcc/fortran/options.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index 9d33352..d1c6841 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -78,10 +78,12 @@ gfc_init_options (unsigned int argc ATTRIBUTE_UNUSED,
flag_argument_noalias = 2;
gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
- | GFC_STD_F2003_OBS | GFC_STD_F2003_DEL | GFC_STD_F2003 | GFC_STD_GNU;
+ | GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F77 | GFC_STD_GNU;
gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
| GFC_STD_F2003;
+ gfc_option.warn_nonstd_intrinsics = 0;
+
return CL_F95;
}
@@ -131,6 +133,7 @@ set_Wall (void)
gfc_option.warn_underflow = 1;
gfc_option.warn_surprising = 1;
gfc_option.warn_unused_labels = 1;
+ gfc_option.warn_nonstd_intrinsics = 1;
set_Wunused (1);
warn_return_type = 1;
@@ -309,24 +312,27 @@ gfc_handle_option (size_t scode, const char *arg, int value)
break;
case OPT_std_f95:
- gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F2003_OBS
- | GFC_STD_F2003_DEL;
+ gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F95 | GFC_STD_F77;
gfc_option.warn_std = GFC_STD_F95_OBS;
gfc_option.max_identifier_length = 31;
break;
case OPT_std_f2003:
- gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F2003_OBS
- | GFC_STD_F2003;
- gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F2003_OBS;
+ gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F77
+ | GFC_STD_F2003 | GFC_STD_F95;
+ gfc_option.warn_std = GFC_STD_F95_OBS;
gfc_option.max_identifier_length = 63;
break;
case OPT_std_gnu:
gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
- | GFC_STD_F2003_OBS | GFC_STD_F2003_DEL | GFC_STD_F2003 | GFC_STD_GNU;
- gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
- | GFC_STD_F2003_OBS | GFC_STD_F2003_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;
+ break;
+
+ case OPT_Wnonstd_intrinsics:
+ gfc_option.warn_nonstd_intrinsics = 1;
break;
}