[Bug fortran/61234] Warn for use-stmt without explicit only-list.

anlauf at gmx dot de gcc-bugzilla@gcc.gnu.org
Tue May 20 21:04:00 GMT 2014


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 ...



More information about the Gcc-bugs mailing list