forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Incorrect Warning

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit
View previous topic :: View next topic  
Author Message
EKruck



Joined: 09 Jan 2010
Posts: 155
Location: Aalen, Germany

PostPosted: Wed Jun 15, 2016 2:04 pm    Post subject: Incorrect Warning Reply with quote

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
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5046
Location: Salford, UK

PostPosted: Wed Jun 15, 2016 10:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
EKruck



Joined: 09 Jan 2010
Posts: 155
Location: Aalen, Germany

PostPosted: Thu Jun 16, 2016 8:58 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5046
Location: Salford, UK

PostPosted: Thu Jun 16, 2016 9:47 am    Post subject: Reply with quote

OK. I have made a note that this needs investigating.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5046
Location: Salford, UK

PostPosted: Mon Jan 30, 2017 12:20 pm    Post subject: Reply with quote

This has now been fixed for the next release.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group