[PATCH, Fortran] PR61234: -Wuse-no-only

Tobias Burnus tobias.burnus@physik.fu-berlin.de
Tue Aug 19 13:13:00 GMT 2014


VandeVondele Joost wrote:
> >> So the negative version is -Wno-use-no-only? That sounds weird.
> > What about -Wuse-without-only?
> 
> Would be fine with me. Approved with this change ?

That would be the patch: https://gcc.gnu.org/ml/fortran/2014-06/msg00114.html

> +Warn if a use statement has no only qualifier and thus implicitly imports
> +all public entities of the used module.

I would use "USE statement" or even "@code{USE} statement".


OK with the documentation change and with the re-named option. Please
also update the name in the code.


Regarding

+     USE foo, ONLY: bar ! { dg-bogus "has no ONLY qualifier" }
+  END SUBROUTINE
+  SUBROUTINE S3
+     USE ISO_C_BINDING ! { dg-warning "has no ONLY qualifier" }
+  END SUBROUTINE S3
+END MODULE
+! { dg-final { cleanup-modules "foo testmod" } }


The "cleanup module" shouldn't be needed as most of the time that
now happens automatically. And "dg-bogus" is also not really needed
as the code checks for excess errors and warnings. On the other hand,
it shouldn't do much harm either.

Thanks for the patch!

Regards,

Tobias



More information about the Gcc-patches mailing list