Silverfrost Forums

Welcome to our forums

Is Shutdown a reserved common block name?

16 Aug 2018 3:36 #22475

Is the name 'Shutdown' reserved for a standard ClearWin+ common block?

I have some code that declares it, on turning up the heat (compiler warnings etc.) I get the following error but have no other references to it.

  1.   common /shutdown/ iwin
    

*** COMMON block /SHUTDOWN/ is already in use as another global entity

If so, it seems implicitly declared so I can just delete it.

16 Aug 2018 8:04 #22476

Ryan

It looks like you have something else with the name 'shutdown'. Some other named entity (not a COMMON BLOCK). If the message appears as a warning then it may be OK to ignore it. I would need the details to say more.

16 Aug 2018 8:06 #22477

I could have missed it, but a global search does not reveal anything else named the same. I'll put it aside for now.

17 Aug 2018 5:47 #22478

Maybe you should just change the name of the common block from 'shutdown' to something more special.

17 Aug 2018 5:54 #22480

I've tried a program with a 'shutdown' common block name and it works for me.

Have you checked all the include files and/or externally compiled modules? Is it a name of a resource, like an icon that is in a .RC file?

It might be worth doing a compilation with /XREF.

Eddie

17 Aug 2018 6:19 #22481

The symbol SHUTDOWN is the name of a routine whose interface is declared in WIN32API.INS. If you include this file in your source code, or use a module that contains an interface to the routine, you cannot use SHUTDOWN as the name of a common block in the same program unit.

Here is an example code that gives the same compile time error message as in the original post.

program tsh
implicit none
include 'win32api.ins'
integer ixy
common /shutdown/ixy
!
ixy = 3
print *,ixy
end program

Attempting to compile this gives

s:\FTN95>ftn95 sd.f90 /check
[FTN95/Win32 Ver. 8.30.279 Copyright (c) Silverfrost Ltd 1993-2018]
0005) common /shutdown/ixy
*** COMMON block /SHUTDOWN/ is already in use as another global entity
    1 ERROR  [<TSH> FTN95 v8.30.279]
*** Compilation failed
20 Aug 2018 8:01 #22483

Apologies, I had notifications turned off so didn't see these responses.

I'd just come to the same answer and found it in win32api. What slowed me down was the error message about it being in use for another common block.

Thank you for your help.

20 Aug 2018 10:51 #22484

Common block names are global entities, but there are other types of global entities as well.

Perhaps, if the error message said, 'the name of the COMMON block /SHUTDOWN/ is already in use as another global entity', instead of the present 'COMMON block /SHUTDOWN/ is already in use as another global entity', there would be less scope for confusion.

Please login to reply.