View previous topic :: View next topic |
Author |
Message |
EKruck
Joined: 09 Jan 2010 Posts: 224 Location: Aalen, Germany
|
Posted: Wed Jun 15, 2016 2:04 pm Post subject: Incorrect Warning |
|
|
Code: | 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 |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7929 Location: Salford, UK
|
Posted: Wed Jun 15, 2016 10:03 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
EKruck
Joined: 09 Jan 2010 Posts: 224 Location: Aalen, Germany
|
Posted: Thu Jun 16, 2016 8:58 am Post subject: |
|
|
Code: | 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. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7929 Location: Salford, UK
|
Posted: Thu Jun 16, 2016 9:47 am Post subject: |
|
|
OK. I have made a note that this needs investigating. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7929 Location: Salford, UK
|
Posted: Mon Jan 30, 2017 12:20 pm Post subject: |
|
|
This has now been fixed for the next release. |
|
Back to top |
|
|
|