summaryrefslogtreecommitdiff
path: root/gcc/fortran/module.c
diff options
context:
space:
mode:
authorvondele <vondele@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-22 10:14:50 +0000
committervondele <vondele@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-22 10:14:50 +0000
commit7cb96c5db267bfcb0e6eb54672c890f1fea73bf0 (patch)
treee461b437e15bff0158a42c3f3887302a848895db /gcc/fortran/module.c
parent4055e07683e8cddd3b539732f61ebe52ec186d70 (diff)
2014-08-22 Joost VandeVondele <Joost.VandeVondele@mat.ethz.ch>
* gfortran.dg/use_without_only_1.f90: New test. 2014-08-22 Joost VandeVondele <Joost.VandeVondele@mat.ethz.ch> PR fortran/61234 * lang.opt (Wuse-without-only): New flag. * gfortran.h (gfc_option_t): Add it. * invoke.texi: Document it. * module.c (gfc_use_module): Warn if needed. * options.c (gfc_init_options,gfc_handle_option): Init accordingly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214311 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r--gcc/fortran/module.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index bd7da1c37df5..3d5e247e1962 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -6741,6 +6741,9 @@ gfc_use_module (gfc_use_list *module)
only_flag = module->only_flag;
current_intmod = INTMOD_NONE;
+ if (!only_flag && gfc_option.warn_use_without_only)
+ gfc_warning_now ("USE statement at %C has no ONLY qualifier");
+
filename = XALLOCAVEC (char, strlen (module_name) + strlen (MODULE_EXTENSION)
+ 1);
strcpy (filename, module_name);