This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/61234] Warn for use-stmt without explicit only-list.
- From: "anlauf at gmx dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 20 May 2014 21:04:22 +0000
- Subject: [Bug fortran/61234] Warn for use-stmt without explicit only-list.
- Auto-submitted: auto-generated
- References: <bug-61234-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61234
Harald Anlauf <anlauf at gmx dot de> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |anlauf at gmx dot de
--- Comment #3 from Harald Anlauf <anlauf at gmx dot de> ---
(In reply to Dominique d'Humieres from comment #1)
> > It would be nice to have a warning (-Wuse-only) for a use-stmt without explicit
> > only-list. It would allow for enforcing this good style with -Werror.
> >
> > Extra useful would be if the warning message would list everything that would
> > be required on the only-list.
>
> IMO such a warning will generate zillions of useless diagnostics, especially
> on codes factored such that most of, if not all, the public objects are
> supposed to be used.
A project that I work on has a (formal) requirement that use-clauses
must restrict imported symbols via "only". (However, many contributors
simply ignore that rule, since the compiler used does not complain.)
g95 provides -Wunused-module-procs and -Wunused-module-vars to
provide this diagnostics which is what I use for "cleaning up".
I do not consider this useless diagnostics.
Obviously, this only works as long as the code is still compilable by g95 ...