This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: PING: [Patch, Fortran] PR 22552: New warning -Wimplicit-procedure
- From: "Manfred Schwarb" <manfred99 at gmx dot ch>
- To: Daniel Kraft <d at domob dot eu>, fortran at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 09 May 2009 23:16:55 +0200
- Subject: Re: PING: [Patch, Fortran] PR 22552: New warning -Wimplicit-procedure
- References: <49E0C2DF.8080301@domob.eu> <4A058F2F.9060909@domob.eu> <4A05930C.9070100@domob.eu>
> And now with patch attached...
>
> Daniel Kraft wrote:
> > ping for the one below!
> >
> > Thanks,
> > Daniel
> >
> > Daniel Kraft wrote:
> >> Hi,
> >>
> >> this implements the warning asked for in PR 22552. A new flag
> >> -Wimplicit-procedure is added, that warns about usage of a procedure
> >> never explicitly declared. That is,
> >>
> >> EXTERNAL :: foobar
> >> CALL foobar ()
> >>
> >> will not trigger this warning, as -Wimplicit-interface would do.
> >> Also, something like
> >>
> >> INTEGER :: foobar
> >>
> >> also prevents the warning, as does an implicit type. This means that
> >> the warning will only ever be issued for SUBROUTINES, as FUNCTIONS
> >> need to have a type.
But this would be quite misleading and unexpected.
I mean, you either warn about implicit procedures, or you do not.
Isn't there something which records whether a variable/function is
implicitly or explicitly typed? ->attr.implicit_type ?
So functions would need to have at least an explicit
INTEGER :: foobar
to prevent the warning. Is this feasible?
Otherwise you should rename this option into -Wimplicit-subroutine
or similar.
Concerning the usefulness: It could be modestly useful for old code
or for code which has to be f77-compatible, but otherwise...
For me personally, it will not be terribly useful, but I would not
want to vote against inclusion.
Cheers,
Manfred
> >>
> >> See the test-case for a full example.
> >>
> >> While I don't think this flag is very useful for new code (there
> >> -Wimplicit-interface could be used better, I guess, when only module
> >> procedures with explicit interfaces are used), the patch is quite
> >> straight-forward and thus I think we can include it to help with those
> >> codes not yet having only explicit-interface procedures.
> >>
> >> I did build this patch on the code snipped provided by FX in the PR.
> >>
> >> Regression-testing on GNU/Linux-x86-32 at the moment. Do you think
> >> this new flag is ok, and ok for trunk if successful?
> >>
> >> Yours,
> >> Daniel
> >>
> >
> >
>
>
> --
> Done: Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz
> To go: Hea-Kni-Mon-Pri
--
Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss für nur 17,95 Euro/mtl.!* http://dslspecial.gmx.de/freedsl-surfflat/?ac=OM.AD.PD003K11308T4569a