diff options
author | Joost VandeVondele <vondele@gcc.gnu.org> | 2014-08-22 10:14:50 +0000 |
---|---|---|
committer | Joost VandeVondele <vondele@gcc.gnu.org> | 2014-08-22 10:14:50 +0000 |
commit | 7e114fadf1ac83f36b1b84c60045ba016c4f37fa (patch) | |
tree | e461b437e15bff0158a42c3f3887302a848895db /gcc/fortran/module.c | |
parent | 3616dc706e703902088fcf055af5da7d410ea18f (diff) | |
download | gcc-7e114fadf1ac83f36b1b84c60045ba016c4f37fa.zip gcc-7e114fadf1ac83f36b1b84c60045ba016c4f37fa.tar.gz gcc-7e114fadf1ac83f36b1b84c60045ba016c4f37fa.tar.bz2 |
re PR fortran/61234 (Warn for use-stmt without explicit only-list.)
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.
From-SVN: r214311
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r-- | gcc/fortran/module.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index bd7da1c..3d5e247 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); |