Silverfrost Forums

Welcome to our forums

Incorrect Warning

15 Jun 2016 1:04 #17673
    MODULE DemoModule
    CHARACTER*32, EXTERNAL :: NAME
    END MODULE DemoModule

Compilation of this module provides a warning: WARNING - 197: Variable NAME has been declared but not used

15 Jun 2016 9:03 #17674

Are you sure that this is incorrect? It seems right to me. My understanding is that EXTERNAL means that NAME is a function that is defined elsewhere so there is no point in declaring it unless it is used.

16 Jun 2016 7:58 #17676
MODULE DemoA

    CHARACTER*32, EXTERNAL :: NameA
    CHARACTER*8   DD
    INTEGER       NN

CONTAINS 

    SUBROUTINE Anton ()
    CHARACTER*32  cResult
    cResult = NameA ('4711')
    cResult = cResult   ! Dummy
    END SUBROUTINE Anton

END MODULE DemoA

MODULE DemoB

    CHARACTER*32 NameB
    EXTERNAL     NameB

END MODULE DemoB

MODULE DemoC

    EXTERNAL     NameC

END MODULE DemoC

I cannot see any reason why an EXTERNAL has to be used inside the MODULE. The variables DD and NN are not used as well. From my understanding a module can be used as well just for declaration without any use. MODULE DemoB does not produce a warning; MODULE DemoC does.

16 Jun 2016 8:47 #17677

OK. I have made a note that this needs investigating.

30 Jan 2017 11:20 #18808

This has now been fixed for the next release.

Please login to reply.