[Bug fortran/24784] Warning about unused routine argument should not read "unused variable"

aldot at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Oct 13 11:46:00 GMT 2006



------- Comment #2 from aldot at gcc dot gnu dot org  2006-10-13 11:46 -------
Current trunk gives:

# -Wall
 In file unused.f90:1

subroutine a(x)
             1
Warning: Unused variable x declared at (1)

# -Wall -W
 In file unused.f90:1

subroutine a(x)
             1
Warning: Unused parameter x declared at (1)
unused.f90:1: warning: unused parameter 'x'


I'm looking into the improper diagnostic emitted by the FE for -Wall only,
but to me it looks like that this is yet another case where the communication
about diagnostics between FE and ME is misbehaving / not existing.

In this case, the ME (function.c::do_warn_unused_parameter() to be specific)
emits a diagnostic that was already dealt with by the FE.

Shouldn't the diagnostic machinery use the FE's diagnostic infrastructure?
Doing so would avoid to set TREE_NO_WARNING for stuff the FE did already
diagnose.

Apart from the above issue, the fortran frontend has it's own warning
infrastructure and it's still unclear to me if it should use the generic one or
not, at least in the long run.


-- 

aldot at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aldot at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24784



More information about the Gcc-bugs mailing list